示例#1
0
        public void TakeRights(int userId)
        {
            if (!this.HasRights(userId))
            {
                return;
            }

            RoomRightsDatabase.TakeRights(this.Room.Id, userId);
            this.UserRights.Remove(this.UserRights.Where(right => right.Id == userId).First());
        }
示例#2
0
        public void GiveRights(int userId)
        {
            if (this.HasRights(userId))
            {
                return;
            }

            RoomRightsDatabase.GiveRights(this.Room.Id, userId);
            UserRight right = new UserRight()
            {
                Id       = userId,
                Username = ""                 //todo:
            };

            this.UserRights.Add(right);
        }
示例#3
0
 public RoomRights(Room room)
 {
     this.UserRights = RoomRightsDatabase.ReadRights(room.Id);
     this.Room       = room;
 }