Ejemplo n.º 1
0
        public Control(Murple.Control murpleControl)
        {
            mMurpleControl = murpleControl;

            mMurpleControl.LoadDatabaseFile(mMurpleDatabaseFilename);
            mMurpleControl.LoadDefinitionFile(mMurpleDefinitionFilename);
            mMurpleControl.LoadDataFile(mMurpleDataFilename);

            PopulateSystem(10);
        }
Ejemplo n.º 2
0
        public Simulation(TextBox mainTextWindow)
        {
            mMurpleControl = new Murple.Control();

            mMurpleControl.LoadDatabaseFile(mMurpleDatabase);
            mMurpleControl.LoadDefinitionFile(mMurpleDefinition);
            mMurpleControl.LoadDataFile(mMurpleData);

            //mMurpleControl.SaveDataFile(mMurpleDataFilename);

            /* DEAD CODE???
            //mMurpleControl.LoadMurpleDataFile(mSystemFilename);
            //mSettings = new Settings(mMurpleControl.GetPod("Settings") );
            //mMurpleControl.GetPod("Settings").OnTick(0);

            //mMurpleControl.Print(mainTextWindow);
            //mMurpleControl.SaveMurpleDataFile(mSystemFilename);
            //mMurpleControl.SaveMurpleDataFile(mMurpleDataFilename);
            */

            mGameMaster = new GameMaster(mMurpleControl, mainTextWindow);

            //{
            // Test: Add a new Pod.
            //Murple.Pod newPod = mMurpleControl.AddMurpleFromDefinition("Pet");
            //newPod.Name = "TestPet";
            //mMurpleControl.AddPod(newPod.UUID, newPod, mMurpleData);
            //}

            {
                // Test: Get a stat value from the stat base and changing it.
                Murple.Pod tempPod = mMurpleControl.GetPod("Willow");
                Murple.StatBase colourStatBase = tempPod.GetStat("Pattern");
                Murple.Database.DatabaseType colourDatabaseType = (Murple.Database.DatabaseType)colourStatBase.Get();

                colourDatabaseType.mDataIndex++;
                if (colourDatabaseType.mDataIndex > 6)
                {
                    colourDatabaseType.mDataIndex = 0;
                }
            }

            {
                string filename = "../../../RatApp/Assets/Resources/Actor2D/Rat/Rat.png";
                Murple.Pod tempPod = mMurpleControl.GetPod("Willow");
                Murple.StatBase imageTestStat = tempPod.GetStat("ImageTest");
                Murple.Image imageTest = (Murple.Image)imageTestStat.Get();

                imageTest.Filename = filename;
            }

            mMurpleControl.SaveDataFile(mMurpleData);
        }