Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public Cell(int x, int y, int cellSize, TurnBasedGame game)
 {
     AgentInCell = null;
     Position    = new Vector2((Single)((x * cellSize) + (cellSize / 2.0)), (Single)((y * cellSize) + (cellSize / 2.0)));
     Game        = game;
     TextureName = CellState.Empty.ToString();
     Index       = new Tuple <int, int>(x, y);
 }
Beispiel #2
0
        /// <summary>
        /// Constructor create shared world
        /// </summary>
        /// <param name="game">The game</param>
        public Environment(TurnBasedGame game, int simulationPerSeconds) : base()
        {
            Turn = 0;
            SimulationPerSeconds = simulationPerSeconds;
            World world = new World(game);

            InitAgents(world);
            Memory["World"] = world;
        }
Beispiel #3
0
        /// <summary>
        /// Contructor build the grid
        /// </summary>
        /// <param name="game">The game</param>
        public World(TurnBasedGame game)
        {
            _map = new Cell[Settings.GridSize, Settings.GridSize];
            for (int i = 0; i < Settings.GridSize; i++)
            {
                for (int j = 0; j < Settings.GridSize; j++)
                {
                    _map[i, j] = new Cell(i, j, 10, game);
                }
            }

            _currentId = 0;
        }
 public GameSessionEventHandler(TurnBasedGame game, ILogger logger)
 {
     _game   = game;
     _logger = logger;
 }