public static Company Factory(ServerGame game, PlayerGameObject controllingPlayer) { Company obj = new Company(game.GameObjectCollection); game.GameObjectCollection.Add(obj); Company.ServerInitialize(obj, controllingPlayer); return obj; }
public SetCompanyPositions(LocalPlayer player, Company co, List<Vector2> positions) { this.Append(co.ID); this.Append(positions.Count); foreach (Vector2 pos in positions) { this.Append(pos); } player.SendTCP(this); }
public AddCombatVehicleToCompany(LocalPlayer player, Company co, CombatVehicle vic) { this.Append(co.ID); this.Append(vic.ID); player.SendTCP(this); }
public AddTransportVehicleToCompany(LocalPlayer player, Company co, Transport vic) { this.Append(co.ID); this.Append(vic.ID); player.SendTCP(this); }
public DeleteCompany(LocalPlayer player, Company co) { this.Append(co.ID); player.SendTCP(this); }
public SetSupplyPoint(LocalPlayer player, Base baseObj, Company co) { this.Append(baseObj.ID); this.Append(co.ID); player.SendTCP(this); }
public CompanySelected(UIContext nextInStack, Company company) : base(nextInStack) { this.selectedCompany = company; }
public static void ServerInitialize(Company obj, PlayerGameObject controllingPlayer) { obj.controllingPlayer.Value = controllingPlayer; }
public void RemoveCompany(Company co) { companies.RemoveAllReferences(co); }
public bool ClickCompanyDelete(Vector2 mouseScreen, Company selectedCo) { int count = 0; foreach (Company co in this.companies.Value) { if (co != null) { Vector2 textSize = MyGraphicsClass.Font.MeasureString(co.GetHudText()); Vector2 xSize = MyGraphicsClass.Font.MeasureString("X"); Rectangle rect = new Rectangle((int)(textSize.X + 5), count, (int)(xSize.X), (int)(xSize.Y)); if (rect.Contains(mouseScreen) && co == selectedCo) { return true; } count = count + (int)(textSize.Y); } } return false; }
public void DrawCompanySelection(GameTime gameTime, MyGraphicsClass myGraphicsClass, Company selectedCo) { int count = 0; foreach (Company co in this.companies.Value) { if (co != null) { Vector2 textSize = MyGraphicsClass.Font.MeasureString(co.GetHudText()); if (co == selectedCo) { myGraphicsClass.DrawRectangle(new Vector2(0, count), textSize, new Vector2(0), 0, Color.Red, 1); myGraphicsClass.DrawDebugFont("X", new Vector2(textSize.X + 5, count), 1); } count = count + (int)(textSize.Y); } } }