示例#1
0
文件: Street.cs 项目: amulware/ld33
 public Intersection OtherNode(Intersection node)
 {
     #if DEBUG
     if(node != this.Node1 && node != this.Node2)
         throw new Exception("Given node is invalid");
     #endif
     return node == this.Node1 ? this.Node2 : this.Node1;
 }
示例#2
0
文件: Street.cs 项目: amulware/ld33
        public Street(GameState game, Intersection node1, Intersection node2, Unit width)
            : base(game)
        {
            this.Node1 = node1;
            this.Node2 = node2;
            this.Width = width;

            node1.AddStreet(this);
            node2.AddStreet(this);

            this.listAs<Street>();
        }