private void Awake() { _speed = Loader.i.mode.BallSpeed; _rb2D = GetComponent <Rigidbody2D>(); _acceleration = GameCalculator.BallAcceleration(); _gravity = GameCalculator.BallGravity(); }
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); }
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); }
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); }
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); }
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
public static int level(this ProfileSaveFile profile) { return(GameCalculator.levelForExperience(profile.Xp)); }
public static int level(this Item item) { return(GameCalculator.levelFromPower(item.Power)); }
private void PlayerOnFramesCompleted() { GameCalculator.CalculateTotalScore(_currentPlayer.PlayerId); RollResults = RollResults.GameOver; }
private void Init() { _ball.Serve(GameCalculator.ServePosition(_nextServe)); }
public DataController() { _gameCalculator = new GameCalculator(); }
public GameCalculatorTests() { _gameCalculator = new GameCalculator(); }