コード例 #1
0
ファイル: SullyGame.cs プロジェクト: Gayo/XNAVERGE
        /// <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()
        {
            // TODO: Add your initialization logic here
            _.init( this );
            main_assembly = System.Reflection.Assembly.GetExecutingAssembly(); // tell the library where to find map scripts
            global = new SullyGlobalScripts(this);

            SkillType.initSkillTypes();
            Klass.initClasses();
            PartyData.InitializePartyData();

            Element.initElements();
            Status.initStatuses();

            Skill.initSkills();
            Item.initItems();

            Enemy.initEnemies();

            init_audio();

            mcg = new McGrenderStack();
            mcg.AddLayer( "menu" );
            mcg.AddLayer( "textbox" );
            mcg.AddLayer( "battle_background" );
            mcg.AddLayer( "battle_sprites" );
            mcg.AddLayer( "battle_ui" );
            this.setMcGrender( mcg );

            this.game_input_handler = () => {

                if( this.mainMenu.CanSummonMenu() && action.menu.pressed ) {
                    this.mainMenu.SummonMenu();
                }

                if( this.mainMenu.IsInMenu() ) {
                    this.mainMenu.HandleInput( dir, action );
                }

                if( mainMenu.IsInMenu() ) {
                    return false;
                }

                return true;
            };

            Battle.LoadBackgrounds( Content );

            boxcolors = new Color[3];
            boxcolors[0] = new Color( 0, 0, 0 );
            boxcolors[1] = new Color( 112, 112, 112 );
            boxcolors[2] = new Color( 144, 144, 144 );

            menuColor = new Color( 128,0,128 );

            inventory = new Inventory();
            saves = new SaveManager(this);

            Random random = new Random();
            foreach( String key in Item.masterItemList.Keys ) {
                inventory.AddItem( Item.masterItemList[key], random.Next( 1, 98 ) );
            }

            saves = new SaveManager(this);

            base.Initialize();
        }
コード例 #2
0
ファイル: SaveHeader.cs プロジェクト: Gayo/XNAVERGE
 public SaveHeader(SaveManager mgr, int idx)
 {
     manager = mgr;
     save_idx = idx;
     party = new List<String>();
 }