Пример #1
0
        internal IntersectController(ObjectDrawer Ob)
        {
            ObjDrawer       = Ob;
            PersList        = new List <Person>();
            BulletList      = new List <Bullet>();
            IntersectThread = new Thread(new ParameterizedThreadStart(CountCollision));

            IntersectThread.Start(this);
        }
Пример #2
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            ///////////////////////////////////////////
            PersonList.Add(new Person()
            {
                X  = Size.Width / 2,
                Y  = Size.Height / 2,
                ID = byte.Parse(Dns.GetHostAddresses(Dns.GetHostName())[Dns.GetHostAddresses(Dns.GetHostName()).Length - 1].ToString().Split('.')[3])
            });

            ////////////////////////////////
            EventAddToDrawList += AddToDrList;
            PackgeWasGot       += AddNetObject;

            ObjDraw       = new ObjectDrawer(BattleField.Image, EventAddToDrawList, SynchronizationContext.Current);
            IC            = new IntersectController(ObjDraw);
            OutNetConnect = new PackageSender();

            AddToNetAddrList += OutNetConnect.AddToAddrIPList;
            InNetConnect      = new PackageReciever(PackgeWasGot, PersonList, AddToNetAddrList);

            ////////////////////////////////////////////////
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting e0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting se0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting s0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting sw0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting w0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting nw0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting n0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "shooting ne0*.bmp"));

            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "walking n0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "walking w0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "walking s0*.bmp"));
            AddToAnimationList(Directory.GetFiles("Resourses//Person//", "walking e0*.bmp"));

            Anims = LoadAnimations(Animations.ToArray());
        }