public void Init() { syster = new Syster(); Type livePowerSystemType = typeof(Syster); FieldInfo field = livePowerSystemType.GetField("powerGrids", BindingFlags.NonPublic | BindingFlags.Instance); Assert.IsNotNull(field); powerGrids = field.GetValue(syster) as HashSet<Grid>; Assert.IsNotNull(powerGrids); Assert.AreEqual(0, powerGrids.Count); }
private void SetupWorld(int width, int height, int depth) { // Setup furniture actions before any other things are loaded. new FurnitureActions(); jobQueue = new JobQueue(); jobWaitingQueue = new JobQueue(); // Set the current world to be this world. // TODO: Do we need to do any cleanup of the old world? Current = this; Width = width; Height = height; Depth = depth; TileType.LoadTileTypes(); tiles = new Tile[Width, Height, Depth]; rooms = new List <Room>(); rooms.Add(new Room()); // Create the outside? for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { for (int z = 0; z < Depth; z++) { tiles[x, y, z] = new Tile(x, y, z); tiles[x, y, z].TileChanged += OnTileChangedCallback; tiles[x, y, z].Room = GetOutsideRoom(); // Rooms 0 is always going to be outside, and that is our default room } } } CreateWallet(); characters = new List <Character>(); furnitures = new List <Furniture>(); inventoryManager = new InventoryManager(); PowerSystem = new Syster(); temperature = new Temperature(Width, Height); LoadSkybox(); }