コード例 #1
0
    public void setMonsterStatus(MonsterType monsterType, bool isReady)
    {
        UserMonsterTO um = getMonster(monsterType);

        um.monsterReady = isReady;
        MarkToSave();
    }
コード例 #2
0
    public int getMonsterLastUsed(MonsterType monsterType)
    {
        UserMonsterTO userMonster = getMonster(monsterType);
        DateTime      now         = DateTime.Now.Date;

        return((int)((now - userMonster.monsterLastUsed).TotalDays));
    }
コード例 #3
0
    public void setMonsterGageValue(Monster monster)
    {
        UserMonsterTO um = getMonster(monster.MonsterType);

        um.monsterGageValue = monster.GageValue;
        MarkToSave();
    }
コード例 #4
0
    public void setMonsterStatus(Monster monster)
    {
        UserMonsterTO um = getMonster(monster.MonsterType);

        um.monsterReady = monster.IsReady;
        MarkToSave();
    }
コード例 #5
0
    UserMonsterTO[] convertMonsters_2(int profileId)
    {
        List <UserMonsterTO> monsters = new List <UserMonsterTO>();

        foreach (MonsterType type in Enum.GetValues(typeof(MonsterType)))
        {
            if (type != MonsterType.NONE)
            {
                UserMonsterTO monster = new UserMonsterTO();

                monster.monsterType = type;

                monster.monsterLevelFaled  = PlayerPrefs.GetInt(getPrefsKey_2(Keys_2.MonsterLevelFaled, profileId, ((int)type).ToString()), 0);
                monster.monsterLastUsed    = new DateTime(long.Parse(PlayerPrefs.GetString(getPrefsKey_2(Keys_2.MonsterLastUsed, profileId, ((int)type).ToString()), System.DateTime.Now.Date.Ticks.ToString())));
                monster.monsterEmotionType = (MonsterEmotionTypes)Enum.Parse(typeof(MonsterEmotionTypes), (PlayerPrefs.GetInt(getPrefsKey_2(Keys_2.MonsterEmotionType, profileId, ((int)type).ToString()), 0)).ToString());
                monster.monsterReady       = ((PlayerPrefs.GetInt(getPrefsKey_2(Keys_2.MonsterReady, profileId, ((int)type).ToString()), 0)) == 1) ? true : false;

                monster.monsterGage      = PlayerPrefs.GetInt(getPrefsKey_2(Keys_2.MonsterGage, profileId, ((int)type).ToString()), 0);
                monster.monsterGageValue = PlayerPrefs.GetFloat(getPrefsKey_2(Keys_2.MonsterGageValue, profileId, ((int)type).ToString()), 0f);

                monsters.Add(monster);
            }
        }
        return(monsters.ToArray());
    }
コード例 #6
0
    public int setMonsterLastUsed(Monster monster)
    {
        UserMonsterTO userMonster = getMonster(monster.MonsterType);

        userMonster.monsterLastUsed = DateTime.Now;

        MarkToSave();

        return(getMonsterLastUsed(monster.MonsterType));
    }
コード例 #7
0
    UserMonsterTO getMonster(MonsterType monsterType)
    {
        UserMonsterTO monster = null;

        if (mMonsters != null && mMonsters.ContainsKey(monsterType))
        {
            monster = mMonsters[monsterType];
        }
        return(monster);
    }
コード例 #8
0
    public void addFriendToCollection(MonsterType monsterType)
    {
        UserMonsterTO userMonster = getMonster(monsterType);

        if (userMonster == null)
        {
            mMonsters.Add(monsterType, UserMonsterTO.create(monsterType));
            MarkToSave();
        }
    }
コード例 #9
0
    public void setMonsterLevelFaled(Monster monster, int num)
    {
        if (monster.MiniGame == MiniGameController.GameType.None)
        {
            return;
        }
        UserMonsterTO userMonster = getMonster(monster.MonsterType);

        userMonster.monsterLevelFaled = num;
        MarkToSave();
    }
コード例 #10
0
    public bool getMonsterStatus(Monster monster)
    {
        UserMonsterTO um     = getMonster(monster.MonsterType);
        bool          status = false;

        if (um != null)
        {
            status = um.monsterReady;
        }
        return(status);
    }
コード例 #11
0
    public void setMonsterEmotionType(Monster monster, MonsterEmotionTypes emotionType)
    {
        if (emotionType == MonsterEmotionTypes.NONE)
        {
            return;
        }
        UserMonsterTO userMonster = getMonster(monster.MonsterType);

        userMonster.monsterEmotionType = emotionType;
        MarkToSave();
    }
コード例 #12
0
    public static UserMonsterTO create(MonsterType type)
    {
        UserMonsterTO monster = new UserMonsterTO();

        monster.monsterType        = type;
        monster.monsterLevelFaled  = 0;
        monster.monsterLastUsed    = DateTime.Now;
        monster.monsterEmotionType = MonsterEmotionTypes.Happy;
        monster.monsterReady       = false;
        monster.monsterGage        = 0;
        monster.monsterGageValue   = 0;
        monster.monsterAccessories = new MonsterAccessoryTO[5];
        return(monster);
    }
コード例 #13
0
    public void updateMonsterAccessory(Monster monster, int categoryId, MonsterAccessoryTO monsterItem)
    {
        UserMonsterTO um = getMonster(monster.MonsterType);

        if (um.monsterAccessories == null)
        {
            um.monsterAccessories = new MonsterAccessoryTO[5];
        }
        if (um.monsterAccessories.Length < categoryId)
        {
            Array.Resize <MonsterAccessoryTO>(ref um.monsterAccessories, 5);
        }
        um.monsterAccessories[categoryId] = monsterItem;

        MarkToSave();
    }
コード例 #14
0
    public MonsterAccessoryTO getMonsterAccessory(MonsterType monsterType, int categoryId)
    {
        UserMonsterTO um = getMonster(monsterType);

        if (um.monsterAccessories == null)
        {
            um.monsterAccessories = new MonsterAccessoryTO[5];
        }
        if (um.monsterAccessories.Length < categoryId)
        {
            Array.Resize <MonsterAccessoryTO>(ref um.monsterAccessories, 5);
        }
        if (um.monsterAccessories[categoryId] != null)
        {
            return(um.monsterAccessories[categoryId]);
        }
        return(null);
    }
コード例 #15
0
    public float getMonsterGageValue(Monster monster)
    {
        UserMonsterTO um = getMonster(monster.MonsterType);

        return(um.monsterGageValue);
    }
コード例 #16
0
    public int getMonsterGage(Monster monster)
    {
        UserMonsterTO um = getMonster(monster.MonsterType);

        return(um.monsterGage);
    }
コード例 #17
0
    public int getMonsterLevelFaled(Monster monster)
    {
        UserMonsterTO userMonster = getMonster(monster.MonsterType);

        return(userMonster.monsterLevelFaled);
    }
コード例 #18
0
    public MonsterEmotionTypes getMonsterEmotionType(Monster monster)
    {
        UserMonsterTO userMonster = getMonster(monster.MonsterType);

        return(userMonster.monsterEmotionType);
    }