Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 5
0
 public DeleteCompany(LocalPlayer player, Company co)
 {
     this.Append(co.ID);
     player.SendTCP(this);
 }
Ejemplo n.º 6
0
 public SetSupplyPoint(LocalPlayer player, Base baseObj, Company co)
 {
     this.Append(baseObj.ID);
     this.Append(co.ID);
     player.SendTCP(this);
 }
Ejemplo n.º 7
0
 public CompanySelected(UIContext nextInStack, Company company)
     : base(nextInStack)
 {
     this.selectedCompany = company;
 }
Ejemplo n.º 8
0
 public static void ServerInitialize(Company obj, PlayerGameObject controllingPlayer)
 {
     obj.controllingPlayer.Value = controllingPlayer;
 }
Ejemplo n.º 9
0
 public void RemoveCompany(Company co)
 {
     companies.RemoveAllReferences(co);
 }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 11
0
 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);
         }
     }
 }