private void SetupTileBrushAction() { foreach (var e in _context.GetEntities(TileMatcher.Tile)) { e.AddTileAction(() => BrushAction(e)); } }
public void Initialize() { foreach (var e in _context.GetEntities(TileMatcher.Tile)) { e.AddTileHoverAction(() => _toolKit.ShowTileDetail(e)); } }
public void Initialize() { var tiles = _context.GetEntities(TileMatcher.Tile); foreach (var originTile in tiles) { originTile.AddTileGraph(null, null, null, null); foreach (var tile in tiles.Where(t => t.mapPosition.GetDistance(originTile.mapPosition) == 1)) { if (tile.mapPosition.y < originTile.mapPosition.y) { originTile.tileGraph.Down = tile; } else if (tile.mapPosition.y > originTile.mapPosition.y) { originTile.tileGraph.Up = tile; } else if (tile.mapPosition.x > originTile.mapPosition.x) { originTile.tileGraph.Right = tile; } else { originTile.tileGraph.Left = tile; } } } }
public void Initialize() { var spawnpoints = _tileContext.GetEntities(TileMatcher.Spawnpoint); var players = _gameContext.GetEntities(GameMatcher.Player); Assert.IsTrue(spawnpoints.Length >= players.Length); int i = 0; foreach (var playerEntity in players.OrderBy(p => p.player.PlayerId)) { var sp = spawnpoints[i]; var characterType = (Character)playerEntity.player.GetNetworkPlayer().SelectedCharacterId; Assert.IsTrue(characterType != Character.None); var character = _unitContext.CreateEntity(); character.AddOwner(playerEntity); character.AddCharacter(characterType); character.AddMapPosition(sp.mapPosition.x, sp.mapPosition.y); i++; } }