Beispiel #1
0
        public void SizeFormOnStart()
        {
            this.Visible = false;
            int screenX, screenY;

            screenX = this.Size.Width;
            screenY = this.Size.Height;
            Size gb1, gb2, gb3 /*, gb4*/;

            gb1 = new Size();
            gb2 = new Size();
#pragma warning disable IDE0017 // Упростите инициализацию объекта
            gb3 = new Size();
#pragma warning restore IDE0017 // Упростите инициализацию объекта
                                //gb4 = new System.Drawing.Size();
                                //Size
                                //===Map

            gb3.Width  = (int)(screenX * 0.6f);
            gb3.Height = (int)(screenY * 0.53f);
            //===Console
            gb2.Width  = (int)(screenX * 0.4f);
            gb2.Height = (int)(screenY * 0.51f);
            //==Mail
            //gb4.Width = (int)(screenX * 0.385f);
            //gb4.Height = (int)(screenY * 0.43f);
            //===Computer
            gb1.Width  = (int)(screenX * 0.37f);
            gb1.Height = (int)(screenY * 0.51f);
            //Location
            Point Lgb2, Lgb3, Lgb4;
            //Map
            //int x1, y1 = 0;
            Random re = new Random();

            Lgb3 = new Point(re.Next(0, screenX - gb3.Width), re.Next(0, screenY - gb3.Height));
            //Console
            //Lgb2 = new Point(0, gb3.Height + 1);
            Lgb2 = new Point(0, 0);
            //Mail
            //Lgb4 = new Point(gb3.Width + 1, -1);
            Lgb4 = new Point(screenX - mailBox.Size.Width - 2, 0);
            //Computer
            //Lgb1 = new Point(gb2.Width + 1, gb4.Height + 1);
            //Init
            //groupBox1.Location = Lgb1;
            //groupBox1.Size = gb1;
            ConsoleBox.Location = Lgb2;
            ConsoleBox.Size     = gb2;
            mapBox.Location     = Lgb3;
            mapBox.Size         = gb3;
            mailBox.Location    = Lgb4;
            //mailBox.Size = gb4;

            this.Visible = true;
            RePoint r = new RePoint(Map.Size.Width, Map.Size.Height);
        }
Beispiel #2
0
        public void Scenarion()
        {
            RePoint p = new RePoint();

#pragma warning disable IDE0017 // Упростите инициализацию объекта
            Game.player = new Player();
#pragma warning restore IDE0017 // Упростите инициализацию объекта
            Game.player.Name              = "Mendax";
            Game.player.Money             = 1000;
            Game.player.Wanted            = 45;
            Game.player.Computer.Position = p.Point(0.33f, 0.5f);
            /////Load Scenario
            Game.Level = 1;
            //ScenaLoad(LoadLua.LoadScenario((byte)Game.Level));
            //ScenaLoad();
            //<<<<<<<<<<<<<<=================

            XMLScenario ss = new XMLScenario();
            ss.ReadEnemy("Data\\LL2\\comp.xml");
            foreach (EnemyComp e in ss.X_Enemies)
            {
                Game.ListEnemy.Add(e);
            }
            ss.ReadQuest("Data\\LL2\\quest.xml");
            foreach (Quest q in ss.X_Quests)
            {
                Game.Questions.Add(q);
            }
            ss.ReadEvent("Data\\LL2\\event.xml");
            foreach (EventGame e in ss.X_Event)
            {
                Game.EventList.Add(e);
            }
            Action <IInitialized> Init = delegate(IInitialized e)
            {
                e.Initialize();
            };
            Game.ListEnemy.ForEach(Init);

            ////////Computer
            Game.player.Computer.InstallMB(listComputer.MBoarList[0]);
            Game.player.Computer.InstallHDD(listComputer.HDDList[0], 0);
            Game.player.Computer.InstallCPU(listComputer.CPUList[0], 0);
            Game.player.Computer.InstallRAM(listComputer.RAMList[0], 0);
            Game.player.Computer.InstallEthernet(listComputer.LANList[0]);
            Game.player.Computer.Initialize();
        }