Create props so we don't have to force the = new State(). If this line doesn't exist, Component throws errors on initialization in buildProps()
public class ModelProps : Props
{
public PlayerState PlayerState = new PlayerState();
public override List<StateContainer> state =>
new List<StateContainer>() {
PlayerState
};
public override void SetState(List<StateContainer> containers)
{
foreach (var container in containers) {
if (container is PlayerState) {
PlayerState = container.Copy as PlayerState;
}
}
}
}
Create props so we don't have to force the
= new State()
. If this line doesn't exist,Component
throws errors on initialization inbuildProps()