コード例 #1
0
ファイル: Company.cs プロジェクト: BenjaminAlexander/materiel
 public static Company Factory(ServerGame game, PlayerGameObject controllingPlayer)
 {
     Company obj = new Company(game.GameObjectCollection);
     game.GameObjectCollection.Add(obj);
     Company.ServerInitialize(obj, controllingPlayer);
     return obj;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public AddCombatVehicleToCompany(LocalPlayer player, Company co, CombatVehicle vic)
 {
     this.Append(co.ID);
     this.Append(vic.ID);
     player.SendTCP(this);
 }
コード例 #4
0
 public AddTransportVehicleToCompany(LocalPlayer player, Company co, Transport vic)
 {
     this.Append(co.ID);
     this.Append(vic.ID);
     player.SendTCP(this);
 }
コード例 #5
0
 public DeleteCompany(LocalPlayer player, Company co)
 {
     this.Append(co.ID);
     player.SendTCP(this);
 }
コード例 #6
0
 public SetSupplyPoint(LocalPlayer player, Base baseObj, Company co)
 {
     this.Append(baseObj.ID);
     this.Append(co.ID);
     player.SendTCP(this);
 }
コード例 #7
0
 public CompanySelected(UIContext nextInStack, Company company)
     : base(nextInStack)
 {
     this.selectedCompany = company;
 }
コード例 #8
0
ファイル: Company.cs プロジェクト: BenjaminAlexander/materiel
 public static void ServerInitialize(Company obj, PlayerGameObject controllingPlayer)
 {
     obj.controllingPlayer.Value = controllingPlayer;
 }
コード例 #9
0
 public void RemoveCompany(Company co)
 {
     companies.RemoveAllReferences(co);
 }
コード例 #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;
 }
コード例 #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);
         }
     }
 }