Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSolarChronus

Posted 03 November 2012 - 07:15 PM

When writing the getters/setters for properties you can specify their access modifier.

Such as:

public int HP
{
	 get { return HP;}
	 protected set { HP = value;}
}

or any combination thereof. The example above allows anyone to access the players HP but only sub-classes can set it. Pretty handy.

#2SolarChronus

Posted 03 November 2012 - 07:15 PM

When writting the getters/setters for properties you can specify their access modifier.

Such as:

public int HP
{
	 get { return HP;}
	 protected set { HP = value;}
}

or any combination thereof. The example above allows anyone to access the players HP but only sub-classes can set it. Pretty handy.

#1SolarChronus

Posted 03 November 2012 - 07:15 PM

When writting the getters/setters for properties, you can specify their access modifier.

Such as:

public int HP
{
     get { return HP;}
     protected set { HP = value;}
}

or any combination thereof. The example above allows anyone to access the players HP but only sub-classes can set it. Pretty handy.

PARTNERS