Esempio n. 1
0
        public void Rename(string name)
        {
            ShipList.Update(Name, null);
            Name = name;

            ShipList.Update(Name, this);
        }
Esempio n. 2
0
        public void SetMemberStatus(ulong id, bool status)
        {
            if (Members.ContainsKey(id))
            {
                Members[id].Status = status;
            }
            else
            {
                throw new MemberNotFoundException();
            }

            ShipList.Update(Name, this);
        }
Esempio n. 3
0
        public void RemoveMember(ulong id)
        {
            if (Members.ContainsKey(id))
            {
                Members.Remove(id);
            }
            else
            {
                throw new MemberNotFoundException();
            }

            ShipList.Update(Name, this);
        }
Esempio n. 4
0
        public void SetMemberType(ulong id, MemberType type)
        {
            if (Members.ContainsKey(id))
            {
                Members[id].Type = type;
            }
            else
            {
                throw new MemberNotFoundException();
            }

            ShipList.Update(Name, this);
        }
Esempio n. 5
0
        public static Ship Create(string name, ulong role, ulong channel)
        {
            if (ShipList.Ships.ContainsKey(name))
            {
                throw new ShipExistsException();
            }
            else
            {
                var created = new Ship(name, role, channel);

                ShipList.Update(name, created);
                return(ShipList.Ships[name]);
            }
        }
Esempio n. 6
0
        public void AddMember(ulong id, MemberType type = MemberType.Member, bool status = false)
        {
            if (Members.ContainsKey(id))
            {
                Console.WriteLine(id);

                throw new MemberExistsException();
            }
            else
            {
                Members[id] = new ShipMember(id, type, status);
            }

            ShipList.Update(Name, this); //updates an element in collection
        }
Esempio n. 7
0
 public void SetStatus(bool status)
 {
     Status = status;
     ShipList.Update(Name, this);
 }
Esempio n. 8
0
 public void SetChannel(ulong id)
 {
     Channel = id;
     ShipList.Update(Name, this);
 }
Esempio n. 9
0
 public void SetRole(ulong id)
 {
     Role = id;
     ShipList.Update(Name, this);
 }