Forum VB .Net Overriding BasePlayer in VB

Overriding BasePlayer in VB

Postby Cyclone103 » February 10th, 2010, 8:14 pm

K so, I wanted to test an override of the BasePlayer class, to add a Username value.


Code: Select all
    Public Class MyPlayer
        Inherits BasePlayer

        Public Username As String = "Test"
    End Class



Yet it isn't showing up when I run the debug server, and all attempts to cast an object of type BasePlayer to type MyPlayer throw an ugly error (obviously because the definition is changed).

All I want is for it to show up somewhere. What am I doing wrong?
Cyclone103
 
Posts: 155
Joined: January 18th, 2010, 6:47 pm

Re: Overriding BasePlayer in VB

Postby Benjaminsen » February 10th, 2010, 8:54 pm

Did you change Inherits Game(Of BasePlayer) to Inherits Game(Of MyPlayer) ?

/Chris
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Overriding BasePlayer in VB

Postby Cyclone103 » February 10th, 2010, 10:25 pm

Oh wow, I fail. Thanks for the help!
Cyclone103
 
Posts: 155
Joined: January 18th, 2010, 6:47 pm


Return to VB .Net



cron