Пример #1
0
        public void DescriptionShouldBeCorrect()
        {
            var    fs          = new FlyingSaucer();
            string description = "Our namesake dish. A full stack of fluffy golden pancakes, served with whipped cream, butter and your choice of syrup.";

            Assert.Equal(description, fs.Description);
        }
Пример #2
0
        public void ShouldBeAbleToSetHalfStack(bool halfStack)
        {
            var fs = new FlyingSaucer();

            fs.HalfStack = halfStack;
            Assert.Equal(halfStack, fs.HalfStack);
        }
Пример #3
0
    //Called when the game ends i.e the player loses all their lives
    public void GameOver()
    {
        HighscoresContainer highscoresContainer = FindObjectOfType <HighscoresContainer>();
        BlockOfAliens       blockOfAliens       = FindObjectOfType <BlockOfAliens>();
        FlyingSaucer        flyingSaucer        = FindObjectOfType <FlyingSaucer>();
        int numHighscores = highscoresContainer.GetNumberOfHighScores();
        int lowestScore   = highscoresContainer.GetLowestScore();

        //If there are less than 10 highscores or the player got a score greater than the lowest high score
        //Then the player has just got a highscore so...
        if (numHighscores < 10 || score > lowestScore)
        {
            //Stop the aliens and flying saucer from moving
            blockOfAliens.SetPaused(true);
            flyingSaucer.gameObject.SetActive(false);
            //Make the add score panel active and give the add score script the new score
            addScore.gameObject.SetActive(true);
            addScore.SetScore(score);
        }
        //Else the player didnt get a high score so...
        else
        {
            //Stop the aliens and flying saucer from moving
            blockOfAliens.SetPaused(true);
            flyingSaucer.gameObject.SetActive(false);
            //Display the game over panel
            gameOver.SetActive(true);
        }
        //Pause the game
        Time.timeScale = 0f;
    }
Пример #4
0
        public void RemovingItemShouldRemoveItem()
        {
            Order        or = new Order(1);
            FlyingSaucer fs = new FlyingSaucer();

            or.AddItem(fs);
            or.RemoveItem(fs);
            Assert.Empty(or.OrderList);
        }
Пример #5
0
        /// <summary>
        /// Handler for event of Flying Saucer Button
        /// Creates new instance of customization window
        /// Passes updated item object back on window close
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void FlyingSaucer_Click(object sender, EventArgs e)
        {
            FlyingSaucerCustom fscWindow = new FlyingSaucerCustom();
            FlyingSaucer       fs        = new FlyingSaucer();

            fscWindow.ShowDialog();
            fs = fscWindow.fs;
            OrderList.Add(fs);
        }
Пример #6
0
        public void ShouldHaveCorrectPriceForSize(bool halfStack, decimal price)
        {
            var fs = new FlyingSaucer()
            {
                HalfStack = halfStack
            };

            Assert.Equal(price, fs.Price);
        }
Пример #7
0
        public void ShouldHaveCorrectCaloriesForSize(bool halfStack, uint calories)
        {
            var fs = new FlyingSaucer()
            {
                HalfStack = halfStack
            };

            Assert.Equal(calories, fs.Calories);
        }
Пример #8
0
        public FlyingSaucer CreateFlyingSaucer(GamePoint createGamePoint, float angleMoveGradus, Player player)
        {
            if (TypeFlyingSaucer.Count == 0)
            {
                throw new InvalidOperationException("В коллекции нет полигонов для отображения летающих тарелок.");
            }
            var points       = TypeFlyingSaucer[_rand.Next(0, TypeFlyingSaucer.Count)];
            var flyingSaucer = new FlyingSaucer(points, angleMoveGradus, createGamePoint, SpeedFlyingSaucer, player);

            Create?.Invoke(this, flyingSaucer);
            return(flyingSaucer);
        }
Пример #9
0
        public void ShouldProvideCurrentSpecialInstructions(bool halfStack, SyrupFlavor syrup, string[] instructions)
        {
            var fs = new FlyingSaucer()
            {
                HalfStack   = halfStack,
                SyrupFlavor = syrup
            };

            foreach (string expectedInstruction in instructions)
            {
                Assert.Contains(expectedInstruction, fs.SpecialInstructions);
            }
            Assert.Equal(instructions.Length, fs.SpecialInstructions.Count);
        }
Пример #10
0
        public void ShouldChangeProperty()
        {
            var fs = new FlyingSaucer();

            fs.SyrupFlavor = SyrupFlavor.Maple;
            Assert.PropertyChanged(fs, "SyrupFlavor", () => fs.SyrupFlavor = SyrupFlavor.Maple);
            fs.SyrupFlavor = SyrupFlavor.Blackberry;
            Assert.PropertyChanged(fs, "SyrupFlavor", () => fs.SyrupFlavor = SyrupFlavor.Blackberry);
            fs.SyrupFlavor = SyrupFlavor.Blueberry;
            Assert.PropertyChanged(fs, "SyrupFlavor", () => fs.SyrupFlavor = SyrupFlavor.Blueberry);
            fs.SyrupFlavor = SyrupFlavor.Cherry;
            Assert.PropertyChanged(fs, "SyrupFlavor", () => fs.SyrupFlavor = SyrupFlavor.Cherry);
            fs.SyrupFlavor = SyrupFlavor.Strawberry;
            Assert.PropertyChanged(fs, "SyrupFlavor", () => fs.SyrupFlavor = SyrupFlavor.Strawberry);

            fs.HalfStack = true;
            Assert.PropertyChanged(fs, "HalfStack", () => fs.HalfStack = true);
            fs.Syrup = false;
            Assert.PropertyChanged(fs, "Syrup", () => fs.Syrup = false);
        }
Пример #11
0
        public void NameShouldBeCorrect()
        {
            var fs = new FlyingSaucer();

            Assert.Equal("Flying Saucer", fs.Name);
        }
Пример #12
0
 public FlyingSaucerCustom()
 {
     fs = new FlyingSaucer();
     InitializeComponent();
 }
Пример #13
0
 public void ReturnFlyingSaucer(FlyingSaucer saucer) => flyingSaucerPool.ReturnItem(saucer.gameObject);