Beyond_Beyaan.Data_Managers.MasterTechnologyManager.Initialize C# (CSharp) Метод

Initialize() публичный Метод

public Initialize ( GameMain gameMain, string &reason ) : bool
gameMain GameMain
reason string
Результат bool
        public bool Initialize(GameMain gameMain, out string reason)
        {
            _gameMain = gameMain;

            //Later we'll replace with data files, but for now, all techs are hard-coded
            ComputerTechs = new List<Technology>();
            ConstructionTechs = new List<Technology>();
            ForceFieldTechs = new List<Technology>();
            PlanetologyTechs = new List<Technology>();
            PropulsionTechs = new List<Technology>();
            WeaponTechs = new List<Technology>();

            LoadComputerTechs();
            LoadConstructionTechs();
            LoadForceFieldTechs();
            LoadPlanetologyTechs();
            LoadPropulsionTechs();
            LoadWeaponTechs();

            reason = null;
            return true;
        }

Usage Example

Пример #1
0
        public bool Initalize(int screenWidth, int screenHeight, DirectoryInfo dataSet, bool showTutorial, Form parentForm, out string reason)
        {
            _parentForm = parentForm;

            Random = new Random();

            MousePos = new Point();

            ScreenWidth = screenWidth;
            ScreenHeight = screenHeight;
            GameDataSet = dataSet;

            Galaxy = new Galaxy();
            EmpireManager = new EmpireManager(this);

            ShipShader = GorgonLibrary.Graphics.FXShader.FromFile("ColorShader.fx", GorgonLibrary.Graphics.ShaderCompileOptions.OptimizationLevel3);
            StarShader = GorgonLibrary.Graphics.FXShader.FromFile("StarShader.fx", GorgonLibrary.Graphics.ShaderCompileOptions.OptimizationLevel3);

            if (!SpriteManager.Initialize(GameDataSet, out reason))
            {
                return false;
            }
            if (!FontManager.Initialize(GameDataSet, out reason))
            {
                return false;
            }
            RaceManager = new RaceManager();
            if (!RaceManager.Initialize(GameDataSet, Random, out reason))
            {
                return false;
            }
            AIManager = new AIManager();
            if (!AIManager.Initialize(GameDataSet, out reason))
            {
                return false;
            }
            MasterTechnologyManager = new MasterTechnologyManager();
            if (!MasterTechnologyManager.Initialize(this, out reason))
            {
                return false;
            }
            _mainGameMenu = new MainGameMenu();
            if (!_mainGameMenu.Initialize(this, out reason))
            {
                return false;
            }

            _screenInterface = _mainGameMenu;
            _currentScreen = Screen.MainMenu;

            _situationReport = new SituationReport(this);

            Cursor = SpriteManager.GetSprite("Cursor", Random);
            if (Cursor == null)
            {
                reason = "Cursor is not defined in sprites.xml";
                return false;
            }

            reason = string.Empty;
            return true;
        }