Ejemplo n.º 1
0
    public void Start()
    {
        inputManager        = GetComponent <InputManager>();
        uiController        = GetComponent <UIController>();
        stateMachineManager = GetComponent <StateMachineManager>();
        gameMath            = GetComponent <GameMath>();
        timeCalculations    = GetComponent <TimeCalculations>();
        save      = GetComponent <Save>();
        load      = GetComponent <Load>();
        player    = GetComponent <Player>();
        resetGame = GetComponent <ResetGame>();

        if (PlayerPrefs.GetInt("CheckIfGameIsSaved") == 1)
        {
            load.LoadGameState();
            uiController.UIControllerUpdate();
            gameMath.GetingGameState();
            gameMath.CalculateLoadGameState();
            CallingGameMathForHungerAndHappienessLoss();
        }

        if (PlayerPrefs.GetInt("OrginalStartBool") == 1)
        {
            load.LoadOrignalGameDate();
        }

        if (PlayerPrefs.GetInt("CheckIfGameIsSaved") != 1)
        {
            SetGameStart();
        }
    }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     formatDuration = 0;
     using (TimeContext db = new TimeContext())
     {
         getLastItems(db);
         Console.Write("Enter your time in seconds: ");
         while (!int.TryParse(Console.ReadLine(), out formatDuration))
         {
             Console.WriteLine("Please, use integer for time display.");
         }
         saveToDB(db, new Time()
         {
             Output = TimeCalculations.Calculations(formatDuration)
         });
     }
 }
Ejemplo n.º 3
0
        public ActionResult TimeFormatting()
        {
            int formatDuration = 0;

            if (int.TryParse(Request["Time"].ToString(), out formatDuration))
            {
                ViewBag.OutputData = TimeCalculations.Calculations(formatDuration);
                db.Times.Add(new Time()
                {
                    Output = ViewBag.OutputData
                });
                db.SaveChanges();
            }
            else
            {
                ViewBag.OutputData = "The number is too large or wrong input data.";
            }
            return(View("Index", db.Times.ToList().Reverse <Time>().Take(5).Reverse()));
        }
Ejemplo n.º 4
0
 private void computeButton_Click(object sender, EventArgs e)
 {
     formatDuration = 0;
     if (int.TryParse(inputData.Text, out formatDuration))
     {
         outputCurrent.Text = TimeCalculations.Calculations(formatDuration);
         db.Times.Add(new Time()
         {
             Output = outputCurrent.Text
         });
         db.SaveChanges();
         OnLoad(e);
     }
     else
     {
         outputCurrent.Text = "The number is too large or wrong input data.";
     }
     inputData.Clear();
 }