public GameWindow(PClass pClass)  // При создании окна принимаем класс будущего игрока
        {
            InitializeComponent();

            Character = new Person(pClass);         // Создаем игрока с ранее полученым классом
            Enemy     = new Person(PClass.PC_MAGE); // Создаем противника
            PassingMove.PassAMove(Character);       // Передаем ход ( выполняем атаку противника )
            DataUpdate();                           // Обновляем информацию
        }
예제 #2
0
        static void Main(string[] args)
        {
            PClass pclass = new PClass();
            System.Type type = pclass.GetType();
            Console.WriteLine(pclass.GetType().IsPublic);

            //delegate x = x => 5 + 5; //
            //delegate MySub(double x); MySub ms = delegate(double y) { y *y; }
            //x => x * x;
            //delegate MySub(); MySub ms = x * x;

            //float f = (float)d;
            //if (float.IsInfinity(f)) throw new OverflowException();

            double d = -1E55;
            System.Type myType = d.GetType();

            //--

            //checked {
            //    long l = 123456789012345;
            //    int i = (int)l;
            //}

            //--

            //string s1 = "          ";
            //string s2 = new string(new char[] {' ',' ',' ',' ',' ',' ',' ',' ',' ',' '});
            //string s3 = new string(' ', 10);
            //string s4 = "".Space(10);

            // --

            //string intput = "123";
            //int output;
            //if (int.TryParse(intput, out output)) {
            //    Console.WriteLine("Successfully parsed input");
            //} else {
            //    Console.WriteLine("Failed to parsed input");
            //}

            //--

            //List<IPrintable> list = new List<IPrintable>();
            //list.Add(new Adder(1, 1));
            //list.Add(new Subtractor(4, 1));
            //list.Add(new Message("TESTING 123"));

            //foreach (var item in list) {

            //    item.printOutput();

            //}

            Console.ReadKey();
        }
예제 #3
0
        public void Test1()
        {
            var request = new PClass <SubClass>()
            {
                A = "aaa",
                B = new SubClass()
                {
                    A = "cccc",
                    B = "dddd"
                }
            }.SerializeMsgPack();

            Console.WriteLine(MessagePackSerializer.ConvertToJson(request));

            var c = request.DeserializeMsgPack <PClass <SubClass> >();
        }
        public int IF1, IF2;                     // Impact Force (Сила удара)

        public Person(PClass pClass)
        {
            switch (pClass)
            {
            case PClass.PC_WARRIOR:
                maxHealth   = 100;
                maxMana     = 20;
                maxArmor    = 130;
                IF1         = 30;
                IF2         = 60;
                this.pClass = PClass.PC_WARRIOR;
                break;

            case PClass.PC_MAGE:
                maxHealth   = 90;
                maxMana     = 130;
                maxArmor    = 30;
                IF1         = 60;
                IF2         = 10;
                this.pClass = PClass.PC_MAGE;
                break;

            case PClass.PC_BERSERK:
                maxHealth   = 130;
                maxMana     = 30;
                maxArmor    = 90;
                IF1         = 60;
                IF2         = 20;
                this.pClass = PClass.PC_BERSERK;
                break;

            default:
                break;
            }

            // Устанавливаем все на максимум в начале игры
            Health = maxHealth;
            Mana   = maxMana;
            Armor  = maxArmor;
        }