private void Awake()
 {
     _speed        = Loader.i.mode.BallSpeed;
     _rb2D         = GetComponent <Rigidbody2D>();
     _acceleration = GameCalculator.BallAcceleration();
     _gravity      = GameCalculator.BallGravity();
 }
示例#2
0
 private void Awake()
 {
     _winScore  = Loader.i.mode.winScore;
     _ball      = GetComponent <BallPhysics>();
     _serveFunc = GameCalculator.ServeFunction(Loader.i.mode.serveMode);
     _nextServe = _serveFunc(new State(), GameManager.i.GameState.CurrentState);
 }
        public void CalculateNumberOfCorrectWordsTest()
        {
            //Arrange
            GameCalculator gameCalculator = new GameCalculator();
            int            expectedValue  = 3;

            string[] words =
            {
                "My",
                "Name",
                "Is",
                "Jeff"
            };
            List <string> words2 = new List <string>
            {
                "My",
                "Name",
                "was",
                "Jeff"
            };

            //Act
            int actualValue = gameCalculator.CalculateWrongsWords(words, words2);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
示例#4
0
        public StatisticsModel(GivenWordsModel words, PlayerModel player, double time)
        {
            GameCalculator gameCalculator = new GameCalculator();

            CorrectWords  = gameCalculator.CalculateCorrectWords(words.GetWords(), player.GetPlayerWords());
            ErrorCount    = gameCalculator.CalculateErrors(words.GetWords(), player.GetPlayerWords());
            NumberOfChars = gameCalculator.CalculateNumberOfChars(words.GetWords());
            NetWpm        = gameCalculator.CalculateNetWpm(NumberOfChars, ErrorCount, time);
        }
示例#5
0
        public static int computeCharacterPower(this ProfileSaveFile profile)
        {
            var melee                 = profile.meleeGearItem()?.Power ?? 0;
            var armor                 = profile.armorGearItem()?.Power ?? 0;
            var ranged                = profile.rangedGearItem()?.Power ?? 0;
            var slot1                 = profile.hotbarSlot1Item()?.Power ?? 0;
            var slot2                 = profile.hotbarSlot2Item()?.Power ?? 0;
            var slot3                 = profile.hotbarSlot3Item()?.Power ?? 0;
            var characterPower        = GameCalculator.characterPowerFromEquippedItemPowers(melee, armor, ranged, slot1, slot2, slot3);
            var chacarterDisplayPower = GameCalculator.levelFromPower(characterPower);

            return(chacarterDisplayPower);
        }
示例#6
0
        public static int pointsCost(this Enchantment enchantment)
        {
            int level = (int)enchantment.Level;
            int cost;

            if (enchantment.isPowerful())
            {
                cost = GameCalculator.powerfulEnchantmentCostForLevel(level);
            }
            else
            {
                cost = GameCalculator.enchantmentCostForLevel(level);
            }
            return(cost);
        }
        public void CalculateNumberOfCharsTest()
        {
            //Arrange
            GameCalculator gameCalculator = new GameCalculator();
            int            expectedValue  = 10;

            string[] words =
            {
                "My",
                "Name",
                "Is",
                "Jeff"
            };

            //Act
            int actualValue = gameCalculator.CalculateNumberOfChars(words);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
示例#8
0
    static void Main(string[] args)
    {
        //This writes the menu to the user
        Console.WriteLine("1: Start Calculator\n2: About \n3: Quit");

        Console.Write("\nUser Input:");
        string userInput = Console.ReadLine();

        if (userInput == "1")
        {
            GameCalculator.StartCalculator();
        }
        else if (userInput == "2")
        {
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Cyan;

            Console.WriteLine("Hey I'm Hannes, I made this");
            Console.WriteLine("Brap Brap");

            Console.ForegroundColor = ConsoleColor.White;
            Console.ReadKey();
        }
        else if (userInput == "3")
        {
            Console.Write("Quiting after 3 seconds");
            System.Threading.Thread.Sleep(3000); //Pause the thread for 3 secounds, written in miliseconds
        }
        else
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("ERROR NO MENU ITEM");

            Console.ReadKey();
            Console.ForegroundColor = ConsoleColor.White;

            System.Threading.Thread.Sleep(3000); //Pause the thread for 3 secounds, written in miliseconds
        }
    }//End of void Main
示例#9
0
 public static int level(this ProfileSaveFile profile)
 {
     return(GameCalculator.levelForExperience(profile.Xp));
 }
示例#10
0
 public static int level(this Item item)
 {
     return(GameCalculator.levelFromPower(item.Power));
 }
示例#11
0
 private void PlayerOnFramesCompleted()
 {
     GameCalculator.CalculateTotalScore(_currentPlayer.PlayerId);
     RollResults = RollResults.GameOver;
 }
示例#12
0
 private void Init()
 {
     _ball.Serve(GameCalculator.ServePosition(_nextServe));
 }
示例#13
0
 public DataController()
 {
     _gameCalculator = new GameCalculator();
 }
 public GameCalculatorTests()
 {
     _gameCalculator = new GameCalculator();
 }