예제 #1
0
 void copy(GameInfoObject gameInfoToCopy)
 {
     sequences    = gameInfoToCopy.sequences;
     explorations = gameInfoToCopy.explorations;
     characters   = gameInfoToCopy.characters;
     places       = gameInfoToCopy.places;
 }
예제 #2
0
        public static void MessageInfoGameTest()
        {
            const string title       = "TestTitle";
            const string description = "TestDescription";
            const string text        = "TestText";

            //AnimationInfo field
            const string fileId    = "100";
            const string mimeType  = "mimeTypeTest";
            const string fileName  = "testFleName";
            const int    fileSize  = 10;
            JObject      animation = AnimationInfoObject.GetObject(fileId, MCommonPhotoSizeInfo, fileName, mimeType, fileSize);

            //MessageEntityInfo field
            const string type     = "TestType";
            const int    offset   = 123456;
            const int    length   = 123456;
            const string url      = "TestUrl";
            JArray       entities = new JArray(MessageEntityInfoObject.GetObject(type, offset, length, url, MCommonUserInfo));

            dynamic messageInfoGame = MCommonMandatoryFieldsMessageInfo;

            messageInfoGame.game = GameInfoObject.GetObject(title, description, new JArray(MCommonPhotoSizeInfo), text, entities, animation);

            MessageInfo messageInfo = new MessageInfo(messageInfoGame);

            Assert.Multiple(() =>
            {
                //Game
                Assert.AreEqual(title, messageInfo.Game.Title);
                Assert.AreEqual(description, messageInfo.Game.Description);
                Assert.AreEqual(text, messageInfo.Game.Text);

                //Game.Entities
                Assert.AreEqual(type, messageInfo.Game.Entities[0].Type);
                Assert.AreEqual(offset, messageInfo.Game.Entities[0].Offset);
                Assert.AreEqual(length, messageInfo.Game.Entities[0].Length);
                Assert.AreEqual(url, messageInfo.Game.Entities[0].Url);

                //Game.Animation
                Assert.AreEqual(fileId, messageInfo.Game.Animation.FileId);
                Assert.AreEqual(fileName, messageInfo.Game.Animation.FileName);
                Assert.AreEqual(mimeType, messageInfo.Game.Animation.MimeType);
                Assert.AreEqual(fileSize, messageInfo.Game.Animation.FileSize);
            });

            //Game.Entites.User
            AssertUserInfo(messageInfo.Game.Entities[0].User);

            //Game.Photo
            AssertPhotoSizeInfo(messageInfo.Game.Photo[0]);

            //Game.Animation.Thumb
            AssertPhotoSizeInfo(messageInfo.Game.Animation.Thumb);
        }
예제 #3
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.J))
        {
            Bag bag = (Bag)Instantiate(items[2]);
            bag.Use();
        }

        if (Input.GetKeyDown(KeyCode.K))
        {
            Bag bag = (Bag)Instantiate(items[1]);
            AddItem(bag);
            bag = (Bag)Instantiate(items[2]);
            AddItem(bag);
            bag = (Bag)Instantiate(items[3]);
            AddItem(bag);
            bag = (Bag)Instantiate(items[4]);
            AddItem(bag);
            bag = (Bag)Instantiate(items[5]);
            AddItem(bag);
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            HealthPotion pot = (HealthPotion)Instantiate(items[0]);
            AddItem(pot);
        }
        if (Input.GetKeyDown(KeyCode.Semicolon))
        {
            AddItem((Armor)Instantiate(items[6]));
            AddItem((Armor)Instantiate(items[10]));
            AddItem((Armor)Instantiate(items[11]));
            AddItem((Armor)Instantiate(items[12]));
            AddItem((Armor)Instantiate(items[13]));
            AddItem((Armor)Instantiate(items[14]));
            AddItem((Armor)Instantiate(items[15]));
            AddItem((Armor)Instantiate(items[16]));
            AddItem((Armor)Instantiate(items[17]));
        }
        if (Input.GetKeyDown(KeyCode.Quote))
        {
            GameInfoObject slvls = (GameInfoObject)Instantiate(items[7]);
            AddItem(slvls);
            GameInfoObject qlvls = (GameInfoObject)Instantiate(items[8]);
            AddItem(qlvls);
            GameInfoObject rlvls = (GameInfoObject)Instantiate(items[9]);
            AddItem(rlvls);
        }
    }
예제 #4
0
 public static void LoadGameInfo()
 {
     gameInfo = new GameInfoObject();
     gameInfo.Load(fileName + "save");
 }