Esempio n. 1
0
        public override void Initialize()
        {
            ISettings settings = (ISettings) Game.Services.GetService(typeof(ISettings));

            World = new World(settings.Rows, settings.Columns);
            Tick = settings.Tick;
            Running = settings.RunAtStart;

            base.Initialize();
        }
 public void SetUp()
 {
     _world = new World();
 }
Esempio n. 3
0
 private List<Tuple<int, int>> GetAllLiveCellsFrom(World world)
 {
     return GetAllLiveCellsFrom(world, 0, world.RowCount, 0, world.ColumnCount);
 }
Esempio n. 4
0
 private List<Tuple<int, int>> GetAllLiveCellsFrom(World world, int firstRow, int rowCount, int firstColumn, int columnCount)
 {
     return (from i in Enumerable.Range(firstRow, rowCount)
             from j in Enumerable.Range(firstColumn, columnCount)
             where world.IsAlive(i, j)
             select Tuple.Create(i, j)).ToList();
 }
Esempio n. 5
0
        public void SetUp()
        {
            wasteland = new World(ROWS, COLUMNS);
            gliderWorld = new World(ROWS, COLUMNS);

            gliderWorld.AddGlider(1, 1);
        }