Exemplo n.º 1
0
            private Color GetCellColor(int x, int y)
            {
                Vector3Int tile_loc   = new Vector3Int(x, y, 0);
                TM_Symbol  cellSymbol = GameMaster.Instance.GridData.GetCellSymbol(tile_loc);

                switch (cellSymbol)
                {
                case TM_Symbol.OFF:
                    return(OffColor);

                case TM_Symbol.ON:
                    return(OnColor);

                case TM_Symbol.NUMBER:
                    return(ErrorColor);

                default:
                    return(ErrorColor);
                }
            }
Exemplo n.º 2
0
 /**
  * <summary>
  * Create a Turing machine transition to be placed in the transition table.
  * </summary>
  * <param name="nextState">The ID of the state to transition to. <see cref="NextState"/></param>
  * <param name="direction">The direction code for the head to move. <see cref="Direction"/></param>
  * <param name="writeSymbol">The symbol to write to the grid. <see cref="WriteSymbol"/></param>
  */
 public Transition(int nextState, TM_Direction direction, TM_Symbol writeSymbol)
 {
     NextState = nextState;
     Direction = direction;
     WriteSymbol = writeSymbol;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Writes the given symbol to the given location on the grid.
 /// </summary>
 /// <param name="loc">Grid location to write the symbol to.</param>
 /// <param name="symbol">The symbol to write to the grid.</param>
 public void WriteSymbolToGrid(Vector3Int loc, TM_Symbol symbol)
 {
     GridData.SetCellSymbol(loc, symbol);
 }