Example #1
0
 /// <summary>
 /// 次の状態を更新します. 現在の状態は変化しません.
 /// </summary>
 public void CalcNextState()
 {
     nextState = currentState.GetNextState(CountAliveNeighborhoods());
 }
Example #2
0
 /// <summary>
 /// 現在の状態を更新します. 必ず先にCalcNextState()を呼び出しておいてください.
 /// </summary>
 public void GetNext()
 {
     currentState = nextState;
 }
Example #3
0
 private LifeGameCell(bool isAlive, LifeGameCell[] cells)
 {
     this.neighborhoods = cells;
     currentState       = isAlive ? CellState.GetLivingState() : CellState.GetDeadState();
     nextState          = currentState;
 }