Пример #1
0
        public void CreateRank(byte id, string name, TribePermission permission)
        {
            var rank = new TribeRank(id)
            {
                Name = name, Permission = permission
            };

            ranks[rank.Id] = rank;
        }
Пример #2
0
        public Error UpdateRank(byte rank, string name, TribePermission permission)
        {
            ITribeRank tribeRank;

            if (!ranks.TryGetValue(rank, out tribeRank))
            {
                return(Error.TribeRankNotFound);
            }

            if (!TribeRank.IsNameValid(name))
            {
                return(Error.TribeRankInvalidName);
            }

            tribeRank.Name = name;
            if (tribeRank != ChiefRank)
            {
                tribeRank.Permission = permission;
            }
            dbManager.Save(this);
            SendRanksUpdate();
            return(Error.Ok);
        }