Exemplo n.º 1
0
        internal void Update(kcsapi_ndock[] source)
        {
            if (this.Docks.Count == source.Length)
            {
                foreach (var raw in source)
                {
                    this.Docks[raw.api_id]?.Update(raw);
                }
            }
            else
            {
                foreach (var dock in this.Docks)
                {
                    dock.Value?.Dispose();
                }

                this.Docks = new MemberTable <RepairingDock>(source.Select(x => new RepairingDock(this.homeport, x)));
            }
        }
Exemplo n.º 2
0
        internal Repairyard(Homeport parent)
        {
            var proxy = Proxy.Instance;

            this.homeport = parent;
            this.Docks    = new MemberTable <RepairingDock>();

            proxy.Register(Proxy.api_get_member_ndock, e =>
            {
                var x = e.TryParse <kcsapi_ndock[]>();
                if (x == null)
                {
                    return;
                }

                this.Update(x.Data);
            });
            proxy.Register(Proxy.api_req_nyukyo_start, e =>
            {
                var x = e.TryParse();
                if (x == null)
                {
                    return;
                }

                this.Start(x);
            });
            proxy.Register(Proxy.api_req_nyukyo_speedchange, e =>
            {
                var x = e.TryParse();
                if (x == null)
                {
                    return;
                }

                this.ChangeSpeed(x);
            });
        }
Exemplo n.º 3
0
        internal Itemyard(Homeport parent)
        {
            var proxy = Proxy.Instance;

            this.homeport = parent;

            this.SlotItems = new MemberTable <SlotItem>();
            this.UseItems  = new MemberTable <UseItem>();

            proxy.Register(Proxy.api_get_member_slot_item, e =>
            {
                var x = e.TryParse <kcsapi_slotitem[]>();
                if (x == null)
                {
                    return;
                }

                this.Update(x.Data);
            });
            proxy.Register(Proxy.api_req_kousyou_createitem, e =>
            {
                var x = e.TryParse <kcsapi_createitem>();
                if (x == null)
                {
                    return;
                }

                this.CreateItem(x.Data);
            });
            proxy.Register(Proxy.api_req_kousyou_destroyitem2, e =>
            {
                var x = e.TryParse <kcsapi_destroyitem2>();
                if (x == null)
                {
                    return;
                }

                this.DestroyItem(x);
            });
            // 전투중 장비 집계는 무시

            proxy.Register(Proxy.api_get_member_useitem, e =>
            {
                var x = e.TryParse <kcsapi_useitem[]>();
                if (x == null)
                {
                    return;
                }

                this.Update(x.Data);
            });
            proxy.Register(Proxy.api_req_kousyou_remodel_slot, e =>
            {
                var x = e.TryParse <kcsapi_remodel_slot>();
                if (x == null)
                {
                    return;
                }

                this.RemoveFromRemodel(x.Data);
                this.RemodelSlotItem(x.Data);
            });
        }
Exemplo n.º 4
0
 internal void Update(kcsapi_useitem[] source)
 {
     this.UseItems = new MemberTable <UseItem>(source.Select(x => new UseItem(x)));
 }