示例#1
0
        // STATES --------------------------------------------------------------------------------------------
        public void SetState(CellState cellState)
        {
            //if (isInitialized) throw new InvalidOperationException("Cell was already initialized!");

            //check if this state is one of the finite states of this cell
            if (!finiteStates.Contains(cellState))
            {
                throw new InvalidOperationException(string.Format("The specified state: {0} is invalid for this type of cell! Please use one of the following: {1}", cellState, PresentationUtils.ListToString(finiteStates)));
            }
            //if it is valid, initialize the cell
            this.cellState = cellState;
            isInitialized  = true;
        }
示例#2
0
 public override String ToString()
 {
     return("Random State Configuration distributing randomly the following Cell states: " + PresentationUtils.ListToString(states));
 }
示例#3
0
 public override String ToString()
 {
     return("Dead cell comes to life when it has exactly " + PresentationUtils.ListToString <int>(LivingNeighborsRequirements) + " living neighbors");
 }
示例#4
0
 public override String ToString()
 {
     return("A living cell remains alive only when surrounded by " + PresentationUtils.ListToString <int>(LivingNeighborsRequirements) + " living neighbors");
 }