예제 #1
0
        public void unPlug(PlugWire toUnplug)
        {
            if (plugConfig.Contains(toUnplug))
            {
                this.unplugged.Add(toUnplug.side1);
                this.unplugged.Add(toUnplug.side2);

                plugConfig.Remove(toUnplug);
            }
        }
예제 #2
0
        public void plugIn(PlugWire toPlugin)
        {
            if (!unplugged.Contains(toPlugin.side2) || !unplugged.Contains(toPlugin.side1))
            {
                throw new Exception(message: "One of those are already plugged in");
            }
            else
            {
                unplugged.Remove(toPlugin.side1);
                unplugged.Remove(toPlugin.side2);

                plugConfig.Add(toPlugin);
            }
        }