I’m following a burgzerg tutorial, this code:
private int BaseValue()
{
get{ return _baseValue; }
set{ _baseValue = value; }
}
Is erroring out, there is no difference between mine and the tutorial’s code. His works.
I’m following a burgzerg tutorial, this code:
private int BaseValue()
{
get{ return _baseValue; }
set{ _baseValue = value; }
}
Is erroring out, there is no difference between mine and the tutorial’s code. His works.
You need to define _baseValue as a private int variable. You probably also want BaseValue to be public I would have thought.
And the most important thing is, this is not a property. You declated a function / method.
Look:
// function
private int BaseValue()
{
//get{ return _baseValue; }
//set{ _baseValue = value; }
}
// property
private int BaseValue
{
get{ return _baseValue; }
set{ _baseValue = value; }
}
Every character in your code, unless it’s in a comment, has a meaning to the compiler. putting two brackets () behind a “variable declaration” makes it a function