示例#1
0
 public Animal(Bridge p_bridge, BridgeSide p_side, short p_animalMovementLimit = 1)
 {
     this.Bridge = p_bridge;
     if (p_side == BridgeSide.Left)
     {
         this.Queue = this.Bridge.LeftSideAnimalList;
     }
     else if (p_side == BridgeSide.Right)
     {
         this.Queue = this.Bridge.RightSideAnimalList;
     }
     else
     {
         throw new InvalidOperationException("An animal cannot be initialized without specifying qhich side oif the bridge it is on.");
     }
     this.Side = p_side;
     this.Queue.Add(this);
     this.Id = NextAnimalId++;
 }
示例#2
0
 public Monkey(Bridge p_bridge, BridgeSide p_side) : base(p_bridge, p_side)
 {
     this.AvatarRelativePath = $"{new FileInfo(this.GetType().Assembly.Location).Directory}\\resource\\monkey.svg";
 }