Exemple #1
0
 public void addLink(LinkStation linkStation)
 {
     if (links.Contains(linkStation) || hasLink(linkStation.getType(), linkStation.getA(), linkStation.getB()))
     {
         throw new ApplicationException("Данная связь уже установлена");
     }
     links.Add(linkStation);
 }
Exemple #2
0
        public void removeLink(LinkStation linkStation)
        {
            RattlerTransportType type = linkStation.getType();

            if (!allLinks.ContainsKey(type))
            {
                return;
            }

            allLinks[type].Remove(linkStation);
        }
Exemple #3
0
        public void addLink(LinkStation linkStation)
        {
            RattlerTransportType type = linkStation.getType();
            List <LinkStation>   links;

            if (allLinks.ContainsKey(type))
            {
                links = allLinks[type];
            }
            else
            {
                links          = new List <LinkStation>();
                allLinks[type] = links;
            }

            if (links.Contains(linkStation) || hasLink(type, linkStation.getA(), linkStation.getB()))
            {
                throw new ApplicationException("Данная связь уже установлена");
            }

            links.Add(linkStation);
        }