Esempio n. 1
0
        static void Main(string[] args)
        {
            List <ITeammate> FrontEnd = new List <ITeammate>()
            {
                new Leah(),
                new Natasha(),
                new Seth()
            };

            List <ITeammate> BackEnd = new List <ITeammate>();

            Robert Robert = new Robert();
            Aaron  Aaron  = new Aaron();
            Will   Will   = new Will();


            BackEnd.Add(Robert);
            BackEnd.Add(Will);
            BackEnd.Add(Aaron);

            foreach (ITeammate member in FrontEnd)
            {
                member.Work();
            }

            foreach (ITeammate member in BackEnd)
            {
                member.Work();
            }
        }
        public IActionResult Index(Aaron a, string calculate, string save)
        {
            if (calculate == "calc")
            {
                a.GameScore = a.Damage + (a.Kills * 75) + (a.Revives * 50) + (a.Respawns * 150) - (a.Revived * 50);

                return(View(a));
            }

            else if (save == "save")
            {
                _context.Aaron.Add(a);
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
        public IActionResult Stats(Aaron a)
        {
            int    gameTotal      = 0;
            double damageTotal    = 0;
            double killTotal      = 0;
            double revivesTotal   = 0;
            double revivedTotal   = 0;
            double respawnsTotal  = 0;
            double gameScoreTotal = 0;
            double damageAvg      = 0;
            double killAvg        = 0;
            double revivesAvg     = 0;
            double respawnsAvg    = 0;
            double revivedAvg     = 0;
            double gameScoreAvg   = 0;


            List <Aaron> aaronStats = _context.Aaron.ToList();

            foreach (var item in aaronStats)
            {
                gameTotal++;
                damageTotal    = damageTotal + item.Damage;
                killTotal      = killTotal + item.Kills;
                revivesTotal   = revivesTotal + item.Revives;
                revivedTotal   = revivedTotal + item.Revived;
                respawnsTotal  = respawnsTotal + item.Respawns;
                gameScoreTotal = gameScoreTotal + item.GameScore;
                damageAvg      = damageTotal / gameTotal;
                killAvg        = killTotal / gameTotal;
                revivesAvg     = revivesTotal / gameTotal;
                revivedAvg     = revivedTotal / gameTotal;
                gameScoreAvg   = gameScoreTotal / gameTotal;
            }

            Console.WriteLine(gameScoreAvg);



            return(View(a));
        }
Esempio n. 4
0
    void Start()
    {
        futilecamera = GameObject.Find("/Futile/Camera");
        SetupFutile();
        version = new FLabel("comfortaa20", "v" + VERSION);
        version.anchorX = 1f;
        version.anchorY = 0f;
        version.x = Futile.screen.halfWidth - 20;
        version.y = -Futile.screen.halfHeight + 15;
        Futile.stage.AddChild(version);

        aaron = GetComponent<Aaron>();
        walkwaysLeft = new FLabel("comfortaa32", "");
        walkwaysLeft.anchorY = 0f;
        walkwaysLeft.y = -Futile.screen.halfHeight + 20;
        Futile.stage.AddChild(walkwaysLeft);

        logo = new FSprite("logo");
        Futile.stage.AddChild(logo);

        youWin = new FLabel("comfortaa32", "Congratulations You Win");
        youLoose = new FLabel("comfortaa32", "Game Over");
    }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     aaron = GameObject.Find("game").GetComponent<Aaron>();
 }