public void Visit()
        {
            CreatePlanets();

            GalaxyController.RemoveVisistable(this);            //Remove this from visitable things.
            PlanetarySystemController.SetPlanetarySystem(this); //Set the current planetary system.
            GameUIController.CreatePlanetarySystemScreen();     //Create the UI.
        }
    public GalaxyController()
    {
        graph = new UndirectedGraph <Node, Starlane>(false, (edge, source, target) => { return(edge.Source == target && edge.Target == source); });

        galaxyController = this;
        galaxy           = new Galaxy();
        galaxy.nodeTypes = new List <Node>();
        //Galaxy.SaveXML(galaxy);
        //galaxy.nodeTypes = new List<Node>();
    }
 private void Awake()
 {
     galaxyPlaceholder  = this.transform;
     displayedNodes     = new Dictionary <GameObject, Node>();
     displayedStarlanes = new Dictionary <GameObject, Starlane>();
     galaxy             = new GalaxyController();
     galaxy.LoadXML();
     galaxy.Generate();
     displayGalaxy = this;
 }
Example #4
0
        public void Load_PlanetarySystems()
        {
            PlanetarySystem[] systems = new PlanetarySystem[PlanetarySystemIds.Length];

            for (int i = 0; i < systems.Length; i++)
            {
                systems[i] = new PlanetarySystem(DataController.LoadData <PlanetarySystemData>(PlanetarySystemIds[i], DataFileType.PlanetarySystems));
            }

            GalaxyController.AddVisitables(systems);
        }
Example #5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content. Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            DataController.Initialize();
            SaveFileController.Initialize();
            GameTipsController.Initialize();
            AudioController.Initialize();

            ShipyardController.Initialize();
            GalaxyController.Initialize();

            AudioController.PlayBackgroundSong("void");

            GameUIController.Initialize();
            GameUIController.CreateLoadingScreen();

            LoadGame();
        }
Example #6
0
    private void Awake()
    {
        GameModel.Set(new GameDebug());
        IsDebug.Subscribe(_ => GameModel.Get <GameDebug>().isActive = _);

        _gameControllers = new List <IGameInit>();

        _player = AddController <PlayerController>();
        _galaxy = AddController <GalaxyController>();
        _star   = AddController <StarController>();
        _planet = AddController <PlanetController>();
        _life   = AddController <LifeController>();

        AddController <UnitPaymentService>();
        AddController <UnitFactory>();
        AddController <UnitController>();
        AddController <SkillController>();
        AddController <SkillPaymentService>();
        AddController <CompoundController>();
        AddController <CompoundPaymentService>();
        //AddController<BuildingController>();
        //AddController<BuildingPaymentService>();

        AddController <HexUpdateCommand>();
        AddController <HexScoreUpdateCommand>();
        AddController <PlanetGenerateCommand>();
        AddController <PlanetPropsUpdateCommand>();
        AddController <UnitDefenseUpdateCommand>();
        AddController <SkillCommand>();
        AddController <UnitEquipCommand>();
        AddController <UnitUseCompoundCommand>();

        AddController <LiveSkill>();
        AddController <MoveSkill>();
        AddController <CloneSkill>();
        AddController <MineSkill>();

        for (int i = 0; i < _gameControllers.Count; i++)
        {
            _gameControllers[i].Init();
        }
    }
Example #7
0
        public void Use()
        {
            Inventory.RemoveItem(this);

            GalaxyController.AddVisitable(new PlanetarySystem(DataController.LoadData <PlanetarySystemData>(data.PlanetarySystemId, DataFileType.PlanetarySystems)));
        }