Ejemplo n.º 1
0
        /// <summary>
        /// Save the specified Booking
        /// </summary>
        /// <returns>Boolean: success</returns>
        /// <param name="args">0: Booking, !: Vehicle, @: Sailing</param>
        public bool Save(params object[] args)
        {
            Booking booking = (Booking)args[0];
            Vehicle vehicle = (Vehicle)args[1];
            Sailing sailing = (Sailing)args[2];

            if (!Directory.Exists(outputFile) || new FileInfo(outputFile).Length == 0)
            {
                return(this.Append(booking.BookingDate, booking.Name, vehicle.License, sailing.Time, vehicle.Type));
            }
            else
            {
                return(this.Create(booking.BookingDate, booking.Name, vehicle.License, sailing.Time, vehicle.Type));
            }
        }
Ejemplo n.º 2
0
        public void Card_SailingAction1()
        {
            //testGame.Players[0].AlwaysParticipates = true;
            //testGame.Players[0].SelectsCards = new List<int>() { 0 };

            bool result = new Sailing().Actions.ToList()[0].ActionHandler(new CardActionParameters {
                TargetPlayer = testGame.Players[0], Game = testGame, ActivePlayer = testGame.Players[0], PlayerSymbolCounts = new Dictionary <IPlayer, Dictionary <Symbol, int> >()
            });

            Assert.AreEqual(true, result);

            Assert.AreEqual(3, testGame.Players[0].Hand.Count);
            Assert.AreEqual(2, testGame.AgeDecks.Where(x => x.Age == 1).FirstOrDefault().Cards.Count);
            Assert.AreEqual(3, testGame.AgeDecks.Where(x => x.Age == 2).FirstOrDefault().Cards.Count);

            Assert.AreEqual(0, testGame.Players[0].Tableau.ScorePile.Count);
            Assert.AreEqual(0, testGame.Players[1].Tableau.ScorePile.Count);

            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Blue].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Green].Cards.Count);
            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Red].Cards.Count);
            Assert.AreEqual(0, testGame.Players[0].Tableau.Stacks[Color.Purple].Cards.Count);
            Assert.AreEqual(1, testGame.Players[0].Tableau.Stacks[Color.Yellow].Cards.Count);
        }