public override void DeleteNestedObjects() { WorldLogic.DeleteNestedObjects(); WorldLogic = null; Grid.DeleteNestedObjects(); Grid = null; }
public WorldLogic(World world, RectangularSpriteGrid grid, Vector2i passerbyPositionInIndices) { this.world = world; this.grid = grid; cells = grid.Cells as RectangularSpriteCell[, ]; SpawnPasserby(cells[passerbyPositionInIndices.Y, passerbyPositionInIndices.X]); SpawnHome(cells[grid.CellCount.Y / 2, grid.CellCount.X / 2]); logicState = WorldLogicState.Check; }
public World() { Vector2i passerbyPositionInIndices = new Vector2i( MathF.RandomInt(StepsCount + 1, 320 - (StepsCount + 1)), MathF.RandomInt(StepsCount + 1, 320 - (StepsCount + 1)) ); var gridSize = new Vector2i( passerbyPositionInIndices.X + StepsCount + 1, passerbyPositionInIndices.Y + StepsCount + 1 ); Grid = new RectangularSpriteGrid(gridSize, CellSize, ResourceLoader.CellSprite); WorldLogic = new WorldLogic(this, Grid, passerbyPositionInIndices); }