Esempio n. 1
0
        protected override StarMapFleet CreateFleet(
            GameObjectSet gos,
            FleetInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapFleet o = new StarMapFleet(this.App, this._db.AssetDatabase.GetMiniShipDirectory(this._sim.App, this._db.GetFactionName(this._db.GetPlayerFactionID(oi.PlayerID)), oi.Type, this._db.GetShipInfoByFleetID(oi.ID, false).ToList <ShipInfo>()).ID);

            if (oi.PlayerID == this._sim.LocalPlayer.ID)
            {
                o.SetSensorRange(GameSession.GetFleetSensorRange(this.App.AssetDatabase, this._db, oi.ID));
            }
            this.UpdateFleet(o, oi, context);
            gos.Add((IGameObject)o);
            return(o);
        }
Esempio n. 2
0
        protected override void UpdateFleet(
            StarMapFleet o,
            FleetInfo oi,
            StarMapBase.SyncContext context)
        {
            FleetLocation fleetLocation = this._db.GetFleetLocation(oi.ID, true);

            o.SetSystemID(fleetLocation.SystemID);
            o.SetPosition(fleetLocation.Coords);
            o.FleetID = oi.ID;
            if (fleetLocation.Direction.HasValue)
            {
                o.SetDirection(fleetLocation.Direction.Value);
            }
            MoveOrderInfo orderInfoByFleetId = this.App.GameDatabase.GetMoveOrderInfoByFleetID(oi.ID);

            if (orderInfoByFleetId != null && (double)orderInfoByFleetId.Progress <= 0.0)
            {
                StarSystemInfo starSystemInfo = this._db.GetStarSystemInfo(fleetLocation.SystemID);
                if (starSystemInfo != (StarSystemInfo)null)
                {
                    o.SetPosition(starSystemInfo.Origin);
                }
            }
            o.SetIsInTransit(orderInfoByFleetId != null && ((double)orderInfoByFleetId.Progress > 0.0 || oi.Type == FleetType.FL_ACCELERATOR && (oi.SystemID == 0 || this._sim.GameDatabase.GetStarSystemInfo(oi.SystemID).IsDeepSpace)));
            o.SetPlayer(this._sim.GetPlayerObject(oi.PlayerID));
            if (oi.PlayerID == this._sim.LocalPlayer.ID)
            {
                o.SetSensorRange(GameSession.GetFleetSensorRange(this.App.AssetDatabase, this._db, oi.ID));
            }
            if (o.ObjectStatus == GameObjectStatus.Ready)
            {
                o.PostSetActive(true);
            }
            o.SetIsLoaGate(oi.Type == FleetType.FL_ACCELERATOR);
        }
Esempio n. 3
0
 protected virtual void UpdateFleet(
     StarMapFleet o,
     FleetInfo oi,
     StarMapBase.SyncContext context)
 {
 }