Example #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            // Use LocalDB for Entity Framework by default
            Database.DefaultConnectionFactory = new SqlConnectionFactory(@"Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True");
            pk  = new PotworyKontekst();
            pk2 = new PotworyKontekst();
            System.Web.HttpContext.Current.Application["BazaPotworow"]       = pk;
            System.Web.HttpContext.Current.Application["BazaPotworowOdczyt"] = pk2;

            b1 = new Bohater()
            {
                Nazwa                 = "Robin",
                PunktyMagii           = 3,
                PunktyZycia           = 3,
                Atak                  = 3,
                Obrona                = 3,
                PunktStartowyLeft     = 100,
                PunktStartowyTop      = 383,
                PunktStartowyLeftTemp = 100,
                PunktStartowyTopTemp  = 383
            };
            p1 = new Plansza1();
            System.Web.HttpContext.Current.Application["Bohater"]       = b1;
            System.Web.HttpContext.Current.Application["ListaPotworow"] = p1.potwory;

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Example #2
0
        static void Main(string[] args)
        {
            KlasaTest klasa = new KlasaTest(4);

            Console.WriteLine(klasa.Druga());
            Console.WriteLine(klasa.TestMetoda(10));
            LinkedList <double> lista = new LinkedList <double>();

            lista.AddFirst(3);
            lista.AddAfter(lista.Find(3), 4);
            lista.AddAfter(lista.Find(4), 5);
            lista.AddAfter(lista.Find(3), 3.5);
            lista.AddAfter(lista.Find(4), 4.5);
            foreach (var d in lista)
            {
                Console.WriteLine(d);
            }
            List <Bohater> postacie = new List <Bohater>();

            postacie.Add(new Bohater(10));
            postacie.Add(new Bohater(8));
            postacie.Add(new Elf(15, "fireball"));
            postacie.Add(new Elf(20, "frostlance"));
            postacie.Add(new Ork(40, 60));
            postacie.Add(new Ork(20, 50));
            postacie.Sort();
            postacie.Reverse();
            foreach (var item in postacie)
            {
                Console.WriteLine(item.ToString());
            }
            Sport sport = Sport.Utworz("Kosz");

            try
            {
                int     hp         = Convert.ToInt32(Console.ReadLine());
                Bohater uzytkownik = new Bohater(hp);
            }
            catch
            {
                Console.WriteLine("Hp musi byc typu int");
            }

            Dictionary <string, List <int> > aa = new Dictionary <string, List <int> >();

            Console.ReadKey();
        }
Example #3
0
            public int CompareTo(object obj)
            {
                if (obj == null)
                {
                    return(1);
                }

                Bohater otherBohater = obj as Bohater;

                if (otherBohater != null)
                {
                    return(this.hp.CompareTo(otherBohater.hp));
                }
                else
                {
                    throw new ArgumentException("Object is not a Temperature");
                }
            }
Example #4
0
 void Awake()
 {
     boh          = bohater.GetComponent <Bohater>();
     curentHealth = boh.podajHp();
     maxHealth    = curentHealth;
 }
Example #5
0
 public StatystykiBohaterem(RozgrywkaGracza rozgrywkaGracza, Bohater bohater)
 {
     RozgrywkaGracza = rozgrywkaGracza;
     Bohater         = bohater;
 }