public TownGroup CreateTownGroup(Tile t_, Player player) { TownGroup newboy = new TownGroup(groups.Count, player); groups.Add(newboy); return(newboy); }
//Merge towns when a bridge is built public void Merge_Towns(TownGroup tg1, TownGroup tg2) { if (tg1 != null && tg2 != null) { if (tg1.Merge_Town_Group(tg2, localPlayer.PointsForTown)) { networkedUI.PanelInteractivityEnDisable(networkedUI.TownTilePanel, true); networkedUI.DisEnableTownTiles(); localPlayer.CheckPoints(PointBonus.Action_Type.FoundTown); } } }
public bool CheckNewTown(TownGroup tg_) { if (tg_.HasATown()) { return(false); } else if (tg_.GetProgress() >= tg_.Get_PointsForTown()) { tg_.SetTownAvailability(true); return(true); } return(false); //IE no town yet and doesnt have enough points to build one }
void Awake() { coordinates = new Coordinate(x, y); terrain = new Terrain(starting_terrain); if (!riverTile) { Terraform(terrain.GetValue()); } gameController = GameObject.Find("Controller").GetComponent <GameController>(); //No building or towngroup to begin with towngroup = null; TileBuilding = new Building(Building.Building_Type.NOTHING); Bridges = new List <Bridge>(); }
public TownGroup MergeTownGroups(List <TownGroup> groups, TownGroup newGroup) { bool newgrouptown = false; foreach (TownGroup tg in groups) { if (tg.HasATown()) { newgrouptown = true; } foreach (Tile t in tg.GetCoordinates()) { AddToTownGroup(t, newGroup); } newGroup.AddTownProgress(tg.GetProgress()); } if (newgrouptown) { newGroup.SetTownAvailability(true); } return(newGroup); }
public bool Merge_Town_Group(TownGroup tg_, int points_for_town) { foreach (Tile t in tg_.GetCoordinates()) { AddTile(t); } AddTownProgress(tg_.GetProgress()); if (tg_.HasATown() || isTown) { isTown = true; } else { if (progressPoints >= points_for_town) { return(true); } } return(false); }
public void MergeTowns(TownGroup tg1, TownGroup tg2) { gameController.Merge_Towns(tg1, tg2); }
public void AddToTownGroup(Tile t_, TownGroup tg_) { t_.SetTownGroup(tg_); tg_.AddTile(t_); }
public void SetTownGroup(TownGroup towngroup_) { towngroup = towngroup_; }