예제 #1
0
 private void SyncFleetShipModels(int systemID)
 {
     foreach (FleetInfo fleetInfo in this.App.GameDatabase.GetFleetInfoBySystemID(systemID, FleetType.FL_NORMAL | FleetType.FL_RESERVE))
     {
         if (fleetInfo.PlayerID == this.App.LocalPlayer.ID)
         {
             foreach (ShipInfo shipInfo in this.App.GameDatabase.GetShipInfoByFleetID(fleetInfo.ID, true))
             {
                 DesignSectionInfo designSectionInfo = ((IEnumerable <DesignSectionInfo>)shipInfo.DesignInfo.DesignSections).FirstOrDefault <DesignSectionInfo>((Func <DesignSectionInfo, bool>)(x => x.ShipSectionAsset.Type == ShipSectionType.Mission));
                 if ((designSectionInfo == null || !ShipSectionAsset.IsBattleRiderClass(designSectionInfo.ShipSectionAsset.RealClass)) && !shipInfo.DesignInfo.IsLoaCube())
                 {
                     List <object> objectList = new List <object>();
                     objectList.Add((object)0);
                     ShipDummy state = new ShipDummy(this.App, CreateShipDummyParams.ObtainShipDummyParams(this.App, shipInfo));
                     this.App.AddExistingObject((IGameObject)state, objectList.ToArray());
                     this._manager.PostObjectAddObjects((IGameObject)state);
                     Vector3?shipFleetPosition = this.App.GameDatabase.GetShipFleetPosition(shipInfo.ID);
                     state.PostSetProp("SetShipID", shipInfo.ID);
                     state.PostSetProp("SetDesignID", shipInfo.DesignID);
                     int commandPointCost = this.App.GameDatabase.GetShipCommandPointCost(shipInfo.ID, true);
                     state.PostSetProp("SetShipCommandCost", commandPointCost);
                     state.FleetID = fleetInfo.ID;
                     state.PostSetProp("SetShipName", shipInfo.ShipName);
                     if (shipFleetPosition.HasValue)
                     {
                         state.PostSetProp("SetFleetPosition", (object)shipFleetPosition.Value.X, (object)shipFleetPosition.Value.Y, (object)shipFleetPosition.Value.Z);
                     }
                     this._shipDummies.Add(state);
                 }
             }
         }
     }
 }
예제 #2
0
 private void SyncFleetShipModels()
 {
     foreach (FleetInfo fleetInfo in this.App.GameDatabase.GetFleetsByPlayerAndSystem(this.App.LocalPlayer.ID, this._targetSystemID, FleetType.FL_ALL))
     {
         if (fleetInfo.PlayerID == this.App.LocalPlayer.ID)
         {
             IEnumerable <ShipInfo> source = this.App.GameDatabase.GetShipInfoByFleetID(fleetInfo.ID, true).Where <ShipInfo>((Func <ShipInfo, bool>)(x => !((IEnumerable <DesignSectionInfo>)x.DesignInfo.DesignSections).Any <DesignSectionInfo>((Func <DesignSectionInfo, bool>)(y => ShipSectionAsset.IsBattleRiderClass(y.ShipSectionAsset.RealClass)))));
             this._manager.PostSetProp("AddFleet", (object)fleetInfo.ID, (object)source.Count <ShipInfo>());
             foreach (ShipInfo shipInfo in source)
             {
                 List <object> objectList = new List <object>();
                 objectList.Add((object)0);
                 ShipDummy state = new ShipDummy(this.App, CreateShipDummyParams.ObtainShipDummyParams(this.App, shipInfo));
                 this.App.AddExistingObject((IGameObject)state, objectList.ToArray());
                 this._manager.PostObjectAddObjects((IGameObject)state);
                 this._pendingObjects.Add((IGameObject)state);
                 Vector3?shipFleetPosition  = this.App.GameDatabase.GetShipFleetPosition(shipInfo.ID);
                 Matrix? shipSystemPosition = this.App.GameDatabase.GetShipSystemPosition(shipInfo.ID);
                 state.PostSetProp("SetShipID", shipInfo.ID);
                 int commandPointCost = this.App.GameDatabase.GetCommandPointCost(shipInfo.DesignID);
                 state.PostSetProp("SetShipCommandCost", commandPointCost);
                 state.PostSetProp("SetFleetID", fleetInfo.ID);
                 state.PostSetProp("SetShipName", shipInfo.ShipName);
                 if (shipFleetPosition.HasValue)
                 {
                     state.PostSetProp("SetFleetPosition", (object)shipFleetPosition.Value.X, (object)shipFleetPosition.Value.Y, (object)shipFleetPosition.Value.Z);
                 }
                 if (shipSystemPosition.HasValue)
                 {
                     state.PostSetProp("SetSystemTransform", shipSystemPosition.Value);
                 }
             }
         }
     }
 }
예제 #3
0
 private void SyncFleetShipModels()
 {
     foreach (int syncedShip in this._manager.GetSyncedShips())
     {
         ShipInfo      shipInfo   = this.App.GameDatabase.GetShipInfo(syncedShip, true);
         List <object> objectList = new List <object>();
         objectList.Add((object)0);
         ShipDummy state = new ShipDummy(this.App, CreateShipDummyParams.ObtainShipDummyParams(this.App, shipInfo));
         this.App.AddExistingObject((IGameObject)state, objectList.ToArray());
         this._manager.PostObjectAddObjects((IGameObject)state);
         this._pendingObjects.Add((IGameObject)state);
         Vector3?shipFleetPosition = this.App.GameDatabase.GetShipFleetPosition(shipInfo.ID);
         state.PostSetProp("SetShipID", shipInfo.ID);
         state.PostSetProp("SetDesignID", shipInfo.DesignID);
         int commandPointCost = this.App.GameDatabase.GetShipCommandPointCost(shipInfo.ID, true);
         state.PostSetProp("SetShipCommandCost", commandPointCost);
         state.FleetID = shipInfo.FleetID;
         state.PostSetProp("SetShipName", shipInfo.ShipName);
         if (shipFleetPosition.HasValue)
         {
             state.PostSetProp("SetFleetPosition", (object)shipFleetPosition.Value.X, (object)shipFleetPosition.Value.Y, (object)shipFleetPosition.Value.Z);
         }
         this._shipDummies.Add(state);
     }
 }