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

            ShipList.Update(Name, this);
        }
Exemple #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);
        }
Exemple #3
0
        public void RemoveMember(ulong id)
        {
            if (Members.ContainsKey(id))
            {
                Members.Remove(id);
            }
            else
            {
                throw new MemberNotFoundException();
            }

            ShipList.Update(Name, this);
        }
Exemple #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);
        }
Exemple #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]);
            }
        }
Exemple #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
        }
Exemple #7
0
 public void Delete()
 {
     ShipList.Remove(Name);
 }
Exemple #8
0
 public void SetStatus(bool status)
 {
     Status = status;
     ShipList.Update(Name, this);
 }
Exemple #9
0
 public void SetChannel(ulong id)
 {
     Channel = id;
     ShipList.Update(Name, this);
 }
Exemple #10
0
 public void SetRole(ulong id)
 {
     Role = id;
     ShipList.Update(Name, this);
 }