Hi so am trying to make this event change when the state is updated for some reason it's not allowing me to compile it's giving the error:
The event 'Entity.StateChanged' can only appear on the left hand side of += or -=
I don't know what's wrong it seems right i tried google it did not help
public Entity.State state
{
get
{
return this._state;
}
set
{
if (this._state != value)
{
this._state = value;
this.OnStateChanged();
}
}
}
protected virtual void OnStateChanged()
{
if (this.StateChanged != null)
{
this.StateChanged();
}
}
public event Action StateChanged
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.StateChanged += value;
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.StateChanged -= value;
}
}
Thank you guy's for your time and help!