This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class MainViewModel : NotifyPropertyChangedBase | |
{ | |
private Simulator.GameState _state; | |
public MainViewModel() | |
{ | |
ResetCommand = new ActionCommand(Reset); | |
Reset(); | |
} | |
public ActionCommand ResetCommand { get; } | |
private void Reset() | |
{ | |
World.World world = WorldGeneration.makeDefaultWorld(); | |
State = new Simulator.GameState(world, Simulator.SimulationState.Simulating, 30); | |
} | |
public Simulator.GameState State | |
{ | |
get => _state; | |
set | |
{ | |
_state = value; | |
OnPropertyChanged(nameof(TextGrid)); | |
OnPropertyChanged(nameof(GameStatusText)); | |
OnPropertyChanged(nameof(TurnsLeftText)); | |
} | |
} | |
// Other properties largely unchanged... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment