public void Undo() { foreach (var connection in _currentConnections) { _layout.AddNodeConnections(connection); } }
public void SavesNodeConnectionToLayout() { var layoutToSave = new PuzzleLayout(); var nodeConnection = new NodeConnection(new TilePos(0, 0), new TilePos(1, 1)); layoutToSave.AddNodeConnections(nodeConnection); var savedLayout = _sut.SaveToFlatLayout(layoutToSave); savedLayout.Connections[0].Should().Be(nodeConnection); }
public void Undo() { foreach (var removedConnection in _removedConnections) { _layout.AddNodeConnections(removedConnection); } foreach (var removedObject in _removedObjects) { _layout.PlaceObject(removedObject.Type, removedObject.Position); } }
public void DoesNotCreateOverlappingTiles() { var layout = new PuzzleLayout(); layout.AddNodeConnections(new NodeConnection(new TilePos(0, 0), new TilePos(1, 0))); layout.PlaceObject("Trap", new TilePos(0, 0)); var pool = new TestGamePool(); new Systems() .Add(pool.CreateSystem <PositionsCacheUpdateSystem>()) .Add(pool.CreateSystem(new GameLevelLoaderSystem(layout))) .Initialize(); var tilesAtPosition = pool.GetEntitiesAt(new TilePos(0, 0), e => e.IsTile()); tilesAtPosition.Count.Should().Be(1); }
public void Execute() { _layout.AddNodeConnections(_connection); }
private void LayoutConnectionBetween(TilePos position1, TilePos position2) { _layout.AddNodeConnections(new NodeConnection(position1, position2)); }