Beispiel #1
0
 protected virtual StarMapFleet CreateFleet(
     GameObjectSet gos,
     FleetInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapFleet)null);
 }
Beispiel #2
0
 protected virtual StarMapFilter CreateFilter(
     GameObjectSet gos,
     StarMapViewFilter filter,
     StarMapBase.SyncContext context)
 {
     return((StarMapFilter)null);
 }
Beispiel #3
0
 protected virtual StarMapProp CreateProp(
     GameObjectSet gos,
     StellarPropInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapProp)null);
 }
Beispiel #4
0
 protected virtual StarMapNodeLine CreateNodeLine(
     GameObjectSet gos,
     NodeLineInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapNodeLine)null);
 }
Beispiel #5
0
 protected virtual StarMapSystem CreateSystem(
     GameObjectSet gos,
     StarSystemInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapSystem)null);
 }
Beispiel #6
0
        public TargetArena(App game, string faction)
        {
            this._game          = game;
            this._objects       = new GameObjectSet(game);
            this._targetObjects = new GameObjectSet(game);
            this._faction       = faction;
            this._targetPlayer  = new Player(game, (GameSession)null, new PlayerInfo()
            {
                AvatarAssetPath = string.Empty,
                BadgeAssetPath  = string.Empty,
                PrimaryColor    = Vector3.One,
                SecondaryColor  = Vector3.One
            }, Player.ClientTypes.AI);
            this._objects.Add((IGameObject)this._targetPlayer);
            Faction          faction1          = game.AssetDatabase.Factions.FirstOrDefault <Faction>((Func <Faction, bool>)(x => x.Name == faction)) ?? game.AssetDatabase.Factions.First <Faction>();
            LogicalWeapon    weapon            = game.AssetDatabase.Weapons.FirstOrDefault <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.WeaponName == "Mis_Missile"));
            LogicalWeapon    weapon1           = game.AssetDatabase.Weapons.FirstOrDefault <LogicalWeapon>((Func <LogicalWeapon, bool>)(x => x.WeaponName == weapon.SubWeapon));
            WeaponModelPaths weaponModelPaths1 = LogicalWeapon.GetWeaponModelPaths(weapon, faction1);
            WeaponModelPaths weaponModelPaths2 = LogicalWeapon.GetWeaponModelPaths(weapon1, faction1);

            weapon.AddGameObjectReference();
            this._launcher = game.AddObject <WeaponTestWeaponLauncher>(new List <object>()
            {
                (object)this._targetPlayer.ObjectID,
                (object)(weapon.GameObject != null ? weapon.GameObject.ObjectID : 0),
                (object)weaponModelPaths1.ModelPath,
                (object)weaponModelPaths2.ModelPath
            }.ToArray());
            this._objects.Add((IGameObject)this._launcher);
            this.ResetTargets();
        }
Beispiel #7
0
 protected virtual StarMapTerrain CreateTerrain(
     GameObjectSet gos,
     TerrainInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapTerrain)null);
 }
Beispiel #8
0
        public override void Initialize()
        {
            this._app.UI.SetEnabled(this._app.UI.Path(this.ID, ReactionDialog.UIConfirmButton), false);
            AdmiralInfo admiralInfo = this._app.GameDatabase.GetAdmiralInfo(this._currentReaction.fleet.AdmiralID);

            if (admiralInfo != null)
            {
                this._app.UI.SetText(this._app.UI.Path(this.ID, ReactionDialog.UIAdmiralLabel), admiralInfo.Name);
            }
            this._sky   = new Sky(this._app, SkyUsage.StarMap, 0);
            this._crits = new GameObjectSet(this._app);
            this._crits.Add((IGameObject)this._sky);
            this._cameraReduced                 = new OrbitCameraController(this._app);
            this._cameraReduced.MinDistance     = 2.5f;
            this._cameraReduced.MaxDistance     = 100f;
            this._cameraReduced.DesiredDistance = 50f;
            this._cameraReduced.DesiredYaw      = MathHelper.DegreesToRadians(45f);
            this._cameraReduced.DesiredPitch    = -MathHelper.DegreesToRadians(25f);
            this._cameraReduced.SnapToDesiredPosition();
            this._starmapReduced = new StarMap(this._app, this._app.Game, this._sky);
            this._starmapReduced.Initialize(this._crits);
            this._starmapReduced.SetCamera(this._cameraReduced);
            this._starmapReduced.FocusEnabled = false;
            this._starmapReduced.SetFocus((IGameObject)this._starmapReduced.Systems.Reverse[this._currentReaction.fleet.SystemID]);
            this._starmapReduced.Select((IGameObject)this._starmapReduced.Systems.Reverse[this._currentReaction.fleet.SystemID]);
            this._starmapReduced.SelectEnabled = false;
            this._starmapReduced.PostSetProp("MissionTarget", (object)this._starmapReduced.Systems.Reverse[this._currentReaction.fleet.SystemID].ObjectID, (object)true);
            this._starmapReduced.PostSetProp("CullCenter", this._app.GameDatabase.GetStarSystemInfo(this._currentReaction.fleet.SystemID).Origin);
            this._starmapReduced.PostSetProp("CullRadius", 15f);
            this._app.UI.Send((object)"SetGameObject", (object)this._app.UI.Path(this.ID, "gameStarMapViewport"), (object)this._starmapReduced.ObjectID);
            this._app.UI.SetVisible(this._app.UI.Path(this.ID, "gameStarMapViewport"), true);
            this._app.PostRequestSpeech(string.Format("STRAT_014-01_{0}_{1}AdmiralGetsReactionPhase", (object)this._app.GameDatabase.GetFactionName(this._app.GameDatabase.GetPlayerFactionID(this._app.LocalPlayer.ID)), (object)admiralInfo.GetAdmiralSoundCueContext(this._app.AssetDatabase)), 50, 120, 0.0f);
            this._crits.Activate();
        }
        protected override void OnPrepare(GameState prev, object[] stateParams)
        {
            base.OnPrepare(prev, stateParams);
            this._targetSystemID   = (int)stateParams[0];
            this._selectedPlanetID = (int)stateParams[1];
            this._sim             = (GameSession)stateParams[2];
            this._selectedFleetID = (int)stateParams[3];
            this._designsToBuild  = (List <int>)stateParams[4];
            this._stationType     = (StationType)stateParams[5];
            this._missionEstimate = (MissionEstimate)stateParams[6];
            this._useDirectRoute  = (bool)stateParams[7];
            this._rebase          = (int?)stateParams[8];
            this._crits           = new GameObjectSet(this.App);
            this._dummies         = new GameObjectSet(this.App);
            DesignInfo di = DesignLab.CreateStationDesignInfo(this.App.AssetDatabase, this.App.GameDatabase, this.App.LocalPlayer.ID, this._stationType, 1, false);
            StarSystemDummyOccupant systemDummyOccupant = new StarSystemDummyOccupant(this.App, this.App.AssetDatabase.ShipSections.First <ShipSectionAsset>((Func <ShipSectionAsset, bool>)(x => x.FileName == di.DesignSections[0].FilePath)).ModelName, this._stationType);

            this._dummies.Add((IGameObject)systemDummyOccupant);
            this._starsystem.PostObjectAddObjects((IGameObject)systemDummyOccupant);
            this._manager = new StationPlacement(this.App, this.App.LocalPlayer.Faction.Name == "zuul");
            this._manager.PostSetProp("SetStarSystem", (IGameObject)this._starsystem);
            this._manager.PostSetProp("SetPlacementStamp", (IGameObject)systemDummyOccupant);
            this._manager.PostSetProp("SetMissionType", (object)this._stationType.ToFlags());
            this.App.UI.LoadScreen("StationPlacement");
        }
        protected override void OnPrepare(GameState prev, object[] stateParams)
        {
            if (this.App.GameDatabase == null)
            {
                this.App.NewGame(new Random(12345));
                if (stateParams == null || stateParams.Length == 0)
                {
                    int orbitalObjectID = this.App.GameDatabase.GetPlayerInfo(this.App.LocalPlayer.ID).Homeworld.Value;
                    stateParams = new object[2]
                    {
                        (object)this.App.GameDatabase.GetOrbitalObjectInfo(orbitalObjectID).StarSystemID,
                        (object)orbitalObjectID
                    };
                }
            }
            int stateParam1 = (int)stateParams[0];
            int stateParam2 = (int)stateParams[1];

            this._crits = new GameObjectSet(this.App);
            this._sky   = new Sky(this.App, SkyUsage.InSystem, stateParam1);
            this._crits.Add((IGameObject)this._sky);
            this._camera     = this._crits.Add <OrbitCameraController>();
            this._planetView = this._crits.Add <PlanetView>();
            this._starsystem = new StarSystem(this.App, 1f, stateParam1, Vector3.Zero, true, (CombatSensor)null, false, 0, this is DefenseManagerState, true);
            this._crits.Add((IGameObject)this._starsystem);
            this._starsystem.PostSetProp("CameraController", (IGameObject)this._camera);
            this._starsystem.PostSetProp("InputEnabled", true);
            this.CurrentSystem  = stateParam1;
            this.SelectedObject = stateParam2;
        }
Beispiel #11
0
 protected override void OnExit(GameState prev, ExitReason reason)
 {
     this.App.HotKeyManager.RemoveListener((IKeyBindListener)this);
     if (this._manager != null)
     {
         this._manager.Dispose();
         this._manager = (FleetManager)null;
     }
     if (this._fleetWidget != null)
     {
         this._fleetWidget.OnFleetsModified -= new FleetWidget.FleetsModifiedDelegate(this.FleetsModified);
         this._fleetWidget.Dispose();
         this._fleetWidget = (FleetWidget)null;
     }
     foreach (ShipDummy shipDummy in this._shipDummies)
     {
         shipDummy.Dispose();
     }
     this._shipDummies = (List <ShipDummy>)null;
     if (this._camera != null)
     {
         this._camera.Dispose();
         this._camera = (OrbitCameraController)null;
     }
     if (this._crits != null)
     {
         this._crits.Dispose();
         this._crits = (GameObjectSet)null;
     }
     this.App.UI.DestroyPanel(this._contextMenuID);
     this.App.UI.DestroyPanel(this._shipContextMenuID);
     this.App.UI.GameEvent -= new UIEventGameEvent(this.UICommChannel_GameEvent);
 }
Beispiel #12
0
 protected virtual StarMapProvince CreateProvince(
     GameObjectSet gos,
     ProvinceInfo oi,
     StarMapBase.SyncContext context)
 {
     return((StarMapProvince)null);
 }
Beispiel #13
0
        protected override StarMapProp CreateProp(
            GameObjectSet gos,
            StellarPropInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapProp starMapProp = new StarMapProp(gos.App, oi.AssetPath, oi.Transform.Position, oi.Transform.EulerAngles, 1f);

            gos.Add((IGameObject)starMapProp);
            return(starMapProp);
        }
Beispiel #14
0
 public SystemWidget(App app, string rootPanel)
 {
     this._rootPanel           = rootPanel;
     this.App                  = app;
     this._crits               = new GameObjectSet(this.App);
     this._planetView          = this._crits.Add <PlanetView>();
     this.App.UI.PanelMessage += new UIEventPanelMessage(this.UICommChannel_OnPanelMessage);
     ++SystemWidget.kWidgetID;
     this._widgetID = SystemWidget.kWidgetID;
 }
Beispiel #15
0
 protected override void OnPrepare(GameState prev, object[] parms)
 {
     this._crits = new GameObjectSet(this.App);
     this._sky   = new Sky(this.App, SkyUsage.InSystem, 0);
     this._crits.Add((IGameObject)this._sky);
     this._camera   = this._crits.Add <OrbitCameraController>();
     this._types    = this.App.AssetDatabase.PlanetGenerationRules.GetStellarBodyTypes();
     this._factions = this.App.AssetDatabase.PlanetGenerationRules.GetFactions();
     this.App.UI.LoadScreen("TestPlanet");
 }
Beispiel #16
0
        protected static StarMapServer CreateServer(
            GameObjectSet gos,
            ServerInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapServer starMapServer = new StarMapServer(gos.App, oi.Origin, oi.name, oi.map, oi.version, oi.players, oi.maxPlayers, oi.ping, oi.passworded);

            gos.Add((IGameObject)starMapServer);
            return(starMapServer);
        }
Beispiel #17
0
        protected override StarMapNodeLine CreateNodeLine(
            GameObjectSet gos,
            NodeLineInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapNodeLine starMapNodeLine = new StarMapNodeLine(this.App, this._db.GetStarSystemOrigin(oi.System1ID), this._db.GetStarSystemOrigin(oi.System2ID));

            gos.Add((IGameObject)starMapNodeLine);
            return(starMapNodeLine);
        }
Beispiel #18
0
 protected override void OnPrepare(GameState prev, object[] parms)
 {
     this._rnd   = new Random();
     this._crits = new GameObjectSet(this.App);
     this._sky   = new Sky(this.App, SkyUsage.InSystem, 0);
     this._crits.Add((IGameObject)this._sky);
     this._camera = this._crits.Add <OrbitCameraController>();
     this._input  = this._crits.Add <CombatInput>();
     this._grid   = this._crits.Add <CombatGrid>();
 }
Beispiel #19
0
 public void Initialize()
 {
     this._builder = new ShipBuilder(this.App);
     this._crits   = new GameObjectSet(this.App);
     this._camera  = new OrbitCameraController(this.App);
     this._camera.DesiredDistance = 10000f;
     this._crits.Add((IGameObject)this._camera);
     this._shipHoloView = new ShipHoloView(this.App, this._camera);
     this._shipID       = 0;
 }
Beispiel #20
0
        protected override StarMapTerrain CreateTerrain(
            GameObjectSet gos,
            TerrainInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapTerrain starMapTerrain = new StarMapTerrain(gos.App, oi.Origin, oi.Name);

            gos.Add((IGameObject)starMapTerrain);
            return(starMapTerrain);
        }
Beispiel #21
0
 protected override void OnPrepare(GameState prev, object[] parms)
 {
     this._crits = new GameObjectSet(this.App);
     this.App.UI.LoadScreen("Sotspedia");
     this._initialPage = null;
     if (parms == null || parms.Length <= 0)
     {
         return;
     }
     this._initialPage = parms[0] as string;
 }
 protected override void OnExit(GameState prev, ExitReason reason)
 {
     this.App.HotKeyManager.RemoveListener((IKeyBindListener)this);
     this._pendingObjects.Clear();
     this._fleetWidget.Dispose();
     this._defenseWidget.Dispose();
     this._dmcrits.Dispose();
     this._dmcrits = (GameObjectSet)null;
     this._manager.Dispose();
     base.OnExit(prev, reason);
 }
Beispiel #23
0
        protected override StarMapFilter CreateFilter(
            GameObjectSet gos,
            StarMapViewFilter type,
            StarMapBase.SyncContext context)
        {
            StarMapFilter starMapFilter = new StarMapFilter(this.App);

            starMapFilter.SetFilterType(type);
            gos.Add((IGameObject)starMapFilter);
            return(starMapFilter);
        }
Beispiel #24
0
        protected override StarMapProvince CreateProvince(
            GameObjectSet gos,
            ProvinceInfo oi,
            StarMapBase.SyncContext context)
        {
            StarMapProvince starMapProvince = new StarMapProvince(this.App);

            starMapProvince.SetLabel(oi.Name);
            gos.Add((IGameObject)starMapProvince);
            return(starMapProvince);
        }
 protected override void OnExit(GameState prev, ExitReason reason)
 {
     this.App.UI.GameEvent -= new UIEventGameEvent(this.UICommChannel_GameEvent);
     this._starsystem       = (StarSystem)null;
     if (this._crits == null)
     {
         return;
     }
     this._crits.Dispose();
     this._crits = (GameObjectSet)null;
 }
 protected override void OnExit(GameState prev, ExitReason reason)
 {
     this._piechart = (BudgetPiechart)null;
     this._manager.Dispose();
     this._crits.Dispose();
     this._crits = (GameObjectSet)null;
     this._dummies.Dispose();
     this._dummies        = (GameObjectSet)null;
     this._sim            = (GameSession)null;
     this._designsToBuild = (List <int>)null;
     base.OnExit(prev, reason);
 }
Beispiel #27
0
        protected override StarMapSystem CreateSystem(
            GameObjectSet gos,
            StarSystemInfo oi,
            StarMapBase.SyncContext context)
        {
            StellarClass  stellarClass  = StellarClass.Parse(oi.StellarClass);
            StarMapSystem starMapSystem = new StarMapSystem(this.App, StarHelper.GetDisplayParams(stellarClass).AssetPath, oi.Origin, StarHelper.CalcRadius(stellarClass.Size) / StarSystemVars.Instance.StarRadiusIa, oi.Name);

            starMapSystem.SetSensorRange(this._sim.GameDatabase.GetSystemStratSensorRange(oi.ID, this._sim.LocalPlayer.ID));
            gos.Add((IGameObject)starMapSystem);
            return(starMapSystem);
        }
Beispiel #28
0
        protected override StarMapSystem CreateSystem(
            GameObjectSet gos,
            StarSystemInfo oi,
            StarMapBase.SyncContext context)
        {
            StellarClass      stellarClass  = StellarClass.Parse(oi.StellarClass);
            StarDisplayParams displayParams = StarHelper.GetDisplayParams(stellarClass);
            StarMapSystem     starMapSystem = new StarMapSystem(gos.App, displayParams.AssetPath, oi.Origin, StarHelper.CalcRadius(stellarClass.Size) / StarSystemVars.Instance.StarRadiusIa, oi.Name);

            gos.Add((IGameObject)starMapSystem);
            return(starMapSystem);
        }
Beispiel #29
0
        public override void Initialize()
        {
            StarSystemInfo starSystemInfo = this._app.GameDatabase.GetStarSystemInfo(this._systemID);

            this._crits             = new GameObjectSet(this._app);
            this._existingTraps     = this.App.GameDatabase.GetColonyTrapInfosAtSystem(this._systemID).Where <ColonyTrapInfo>((Func <ColonyTrapInfo, bool>)(x => this.App.GameDatabase.GetFleetInfo(x.FleetID).PlayerID == this.App.LocalPlayer.ID)).ToList <ColonyTrapInfo>();
            this._placedTraps       = new List <int>();
            this._currentFilterMode = DialogColonyTrap.PlanetFilterMode.AllPlanets;
            this._planetWidgets     = new List <PlanetWidget>();
            this.SetSyncedSystem(starSystemInfo);
            this.UpdateNumRemainingTraps();
        }
Beispiel #30
0
 protected override void OnInitialize(GameObjectSet gos, params object[] parms)
 {
     if (this._sim.IsMultiplayer)
     {
         this.PostObjectAddObjects((IGameObject) new StarMapServerName(this.App, new Vector3(0.0f, 0.0f, 0.0f), this.App.Network.GameName));
     }
     StarMapBase.SyncContext context = new StarMapBase.SyncContext(this._db);
     this.CreateFilter(gos, StarMapViewFilter.VF_SUPPORT_RANGE, context);
     this.CreateFilter(gos, StarMapViewFilter.VF_SENSOR_RANGE, context);
     this.CreateFilter(gos, StarMapViewFilter.VF_TRADE, context);
     this.Props.Sync(gos, this._db.GetStellarProps(), context, false);
     this.Sync(gos);
 }