Пример #1
0
        static public Squad CreateSquad(SquadPattern pattern, string playerID)
        {
            if (pattern == null)
            {
                return(null);
            }

            return(new Squad(playerID, pattern.name, pattern.level));
        }
Пример #2
0
        public void AfterTutosGift(string playerID)
        {
            AddSquadInInventory(Squad.CreateSquad(SquadPattern.GetSquadPattern("Servant", 1), playerID));
            AddSquadInInventory(Squad.CreateSquad(SquadPattern.GetSquadPattern("Meca", 1), playerID));
            AddSquadInInventory(Squad.CreateSquad(SquadPattern.GetSquadPattern("Archers", 1), playerID));

            ServerManager.Instance.SavePlayerDatas(this);

            AddWorld(playerID, 0, WorldInfos.worldInfos[0].name, 0, false);
            GetWorld(0).AddLevel(playerID, 0, 0, true, true);
        }
Пример #3
0
        public void UpgradeSquad()
        {
            SquadPattern squadPattern = SquadPattern.GetSquadPattern(name, level + 1);

            if (squadPattern != null)
            {
                level++;
            }
            else
            {
                Debug.LogError("[PlayeDatas] Can't upgrade, no such squad in Inventory");
            }
        }
Пример #4
0
        public Squad(string playerID, string name, int level, string id = null)
        {
            this.name  = name;
            this.level = level;

            if (SquadPattern.GetSquadPattern(name, level) == null)
            {
                Debug.LogWarning("[Squad] No such squad in memory");
            }

            this.playerID = playerID;
            this.id       = id == null?PlayerDatas.GetUniqueID(playerID) : id;
        }
Пример #5
0
        public void UpgradeSquad(Squad squadtoUpgrade)
        {
            SquadPattern squadPattern = SquadPattern.GetSquadPattern(squadtoUpgrade.name, squadtoUpgrade.level + 1);

            if (squadPattern != null)
            {
                squadtoUpgrade.level++;
                ServerManager.Instance.SaveSquad(squadtoUpgrade);
            }
            else
            {
                Debug.LogError("[PlayeDatas] Can't upgrade, no such squad in Inventory");
            }
        }