Beispiel #1
0
        public void setLevel(EnumGameLevel gl)
        {
            switch (gl)
            {
            case EnumGameLevel.EASY:
                isHeroRandom  = false;
                numberThreats = 5;
                gameLevel     = gl;
                break;

            case EnumGameLevel.MEDIUM:
                isHeroRandom  = true;
                numberThreats = 5;
                gameLevel     = gl;
                break;

            case EnumGameLevel.HARD:
                isHeroRandom  = true;
                numberThreats = 8;
                gameLevel     = gl;
                break;
            }
            createHeroList();
            createThreatList();
            round = new Round(randomThreatList[0], heroList);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            /*
             * Context context = this;
             * createHeroes(context.Resources);
             */
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Game);

            NewGame       newGame = NewGame.CreateNewGame();
            EnumGameLevel level   = (EnumGameLevel)Intent.GetIntExtra("level", -1);

            newGame.setLevel(level);
            LinearLayout HeroPanel = FindViewById <LinearLayout>(Resource.Id.HeroPanel);

            for (int i = 0; i < HeroPanel.ChildCount; ++i)
            {
                LinearLayout dziecko = (LinearLayout)HeroPanel.GetChildAt(i);
                showHero.Add(new GUIHero(dziecko));
            }
            Context    context    = this;
            Controller controller = new Controller(newGame, this);

            controller.createHeroes(context.Resources);
            controller.createDicePool(context.Resources);
            Console.WriteLine("tu jestem!!!");
            controller.createThreat(context.Resources);
            // Create your application here
        }
Beispiel #3
0
        public void writeHero(EnumGameLevel egl, Round round)
        {
            switch (egl)
            {
            case EnumGameLevel.EASY:
                for (int i = 0; i < 8; ++i)
                {
                    if (round.heroList[i].iD == round.currentHero.iD)
                    {
                        Console.Write("i:" + i + "\n");
                        Console.WriteLine("-> {0,-6} {1, -18} {2}", round.heroList[i].click, round.heroList[i].name, round.heroList[i].descSkill);
                    }
                    else
                    {
                        if (round.heroList[i].isExhausted == true)
                        {
                            Console.WriteLine("EXHAUSTED {0,-3} {1, -18} {2}", round.heroList[i].click, round.heroList[i].name, round.heroList[i].descSkill);
                        }
                        else
                        {
                            Console.WriteLine("   {0,-6} {1, -18} {2}", round.heroList[i].click, round.heroList[i].name, round.heroList[i].descSkill);
                        }
                    }
                }
                break;

            default:
                for (int i = 0; i < 8; ++i)
                {
                    if (round.heroList[i].iD == round.currentHero.iD)
                    {
                        Console.WriteLine("-> {0,-15} {1}", round.heroList[i].name, round.heroList[i].descSkill);
                    }
                    else
                    {
                        if (round.heroList[i].isExhausted == true)
                        {
                            Console.WriteLine("EXHAUSTED {0,-24} {1}", round.heroList[i].name, round.heroList[i].descSkill);
                        }
                        else
                        {
                            Console.WriteLine("{0,-15} {1}", round.heroList[i].name, round.heroList[i].descSkill);
                        }
                    }
                }
                break;
            }
        }