Ejemplo n.º 1
0
 public override bool canMove()
 {
     if (location is WaterQuay)
     {
         if (isLoaded)
         {
             return(true);
         }
         return(false);
     }
     else
     {
         WaterLink nextWaterLink = (WaterLink)location.Next;
         if (nextWaterLink == null)
         {
             location.Occupant = null;
             this.location     = null;
             return(false);
         }
         if (nextWaterLink.Occupant == null)
         {
             return(true);
         }
         return(false);
     }
 }
Ejemplo n.º 2
0
 public override void Move()
 {
     if (canMove())
     {
         location.Occupant = null;
         this.location     = (WaterLink)location.Next;
         location.Occupant = this;
     }
 }
Ejemplo n.º 3
0
 public Board(int score, Track TrackEnd, List <Hangar> hangars, Dictionary <char, Turnout> turnouts, WaterQuay quay, HasNext[][] GameBoard, WaterLink first)
 {
     Score               = score;
     this.quay           = quay;
     this.TrackEnd       = TrackEnd;
     Hangars             = hangars;
     Turnouts            = turnouts;
     random              = new Random();
     Carts               = new List <Cart>();
     Ships               = new List <Ship>();
     FirstRiver          = first;
     FirstRiver.Occupant = new Ship(FirstRiver);
     Ships.Add(FirstRiver.Occupant);
     _GameBoard = GameBoard;
     foreach (var t in turnouts)
     {
         for (int i = random.Next(1, 3); i >= 0; i--)
         {
             t.Value.ChangeDirection();
         }
     }
 }
Ejemplo n.º 4
0
        // private bool isDocked;

        public Ship(WaterLink locate)
        {
            location = locate;
            load     = 0;
        }