コード例 #1
0
        public List <Dashboard> GetDashboard(string dashName)
        {
            Connect();
            Dashboard newDashboard;

            BinaryCodec <Request>   binCodReq  = new BinaryCodec <Request>();
            BinaryCodec <Dashboard> binCodDash = new BinaryCodec <Dashboard>();
            Request request = new Request("Get dashboard", dashName);

            byte[] sndBuffer = binCodReq.Encode(request);

            binWriter.Write(sndBuffer.Length);
            binWriter.Write(sndBuffer);

            int receivingDashboards = binReader.ReadInt32();
            int receiveBytes;
            List <Dashboard> dashboardList = new List <Dashboard>();

            for (int i = 0; i < receivingDashboards; i++)
            {
                receiveBytes = binReader.ReadInt32();
                byte[] receivedBuffer = binReader.ReadBytes(receiveBytes);
                newDashboard = binCodDash.Decode(receivedBuffer);
                dashboardList.Add(newDashboard);
            }

            Dispose();

            return(dashboardList);
        }
コード例 #2
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _scene))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _index))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _characterName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _text))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _eventid))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _nextsceneid))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _skip))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _bg))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _left_character))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _right_character))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _fontsize))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _fonteffect))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _bgm))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _sound))
     {
         return(false);
     }
     return(true);
 }
コード例 #3
0
        /// <summary>
        /// Solicita un dashboard y retorna una lista con todos los tableros cuyo título coincida con ese nombre
        /// </summary>
        /// <param name="dashName">Nombre el dashboard solicitado</param>
        /// <returns>Lista de tableros cuyo título coincida con el indicado</returns>
        public List <Dashboard> GetDashboard(string dashName)
        {
            TcpClient     tcpClient = Connect();
            NetworkStream netStr    = tcpClient.GetStream();
            Dashboard     newDashboard;

            BinaryCodec <Request>   binCodReq  = new BinaryCodec <Request>();
            BinaryCodec <Dashboard> binCodDash = new BinaryCodec <Dashboard>();
            Request request = new Request("Get dashboard", dashName);

            byte[]           sndBuffer     = binCodReq.Encode(request);
            List <Dashboard> dashboardList = new List <Dashboard>();

            using (BinaryWriter bw = new BinaryWriter(netStr))
                using (BinaryReader br = new BinaryReader(netStr))
                {
                    bw.Write(sndBuffer.Length);
                    bw.Write(sndBuffer);

                    int receivingDashboards = br.ReadInt32();
                    int receiveBytes;


                    for (int i = 0; i < receivingDashboards; i++)
                    {
                        receiveBytes = br.ReadInt32();
                        byte[] receivedBuffer = br.ReadBytes(receiveBytes);
                        newDashboard = binCodDash.Decode(receivedBuffer);
                        dashboardList.Add(newDashboard);
                    }
                }
            Dispose(tcpClient);

            return(dashboardList);
        }
コード例 #4
0
        public Image[] RequestImages(string[] imagesRequested)
        {
            Connect();

            BinaryCodec <Image>   binCodImage = new BinaryCodec <Image>();
            BinaryCodec <Request> binCodReq   = new BinaryCodec <Request>();

            Image[] imagesReceived = new Image[imagesRequested.Length];
            int     position       = 0;

            foreach (string image in imagesRequested)
            {
                Request request   = new Request("Get image", image);
                byte[]  sndBuffer = binCodReq.Encode(request);

                binWriter.Write(sndBuffer.Length);
                binWriter.Write(sndBuffer);

                int    receiveBytes   = binReader.ReadInt32();
                byte[] receivedBuffer = binReader.ReadBytes(receiveBytes);
                imagesReceived[position] = binCodImage.Decode(receivedBuffer);
                position++;
            }
            Dispose();
            return(imagesReceived);
        }
コード例 #5
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _itemID))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemDesc))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _iconName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _price))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _weaponType = (E_WeaponType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _physicalDamage))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalDamage))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _physicalCritChance))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalCritChance))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _physicalRate))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalRate))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _option))
     {
         return(false);
     }
     return(true);
 }
コード例 #6
0
        public void DecodeBase64Test()
        {
            // double delta = 0.0001;

            var codec = new BinaryCodec();

            // test null arguments.
            Assert.Catch <ArgumentNullException>(() => {
                codec.Decode(null);
            });

            // test invalid arguments.
            Assert.Catch <FormatException>(() =>
            {
                codec.Decode("InvalidCode");
            });
        }
コード例 #7
0
        public void TestMethod7()
        {
            Image image = new Image("", "C:\\Users\\Desktop Javier\\Desktop\\TestFoto.png");
            BinaryCodec <Image> binCod = new BinaryCodec <Image>();

            byte[] imCod = binCod.Encode(image);

            Image imageDecod = binCod.Decode(imCod);

            Assert.AreEqual(image.FileBase64, imageDecod.FileBase64);
        }
        public void TestMethod6()
        {
            Request request = new Request("Image", "");
            BinaryCodec <Request> binCod = new BinaryCodec <Request>();

            byte[] reqCod = binCod.Encode(request);

            Request reqDecod = binCod.Decode(reqCod);

            Assert.AreEqual(request.RequestBody, reqDecod.RequestBody);
        }
        public void TestMethod7()
        {
            Request request = new Request("", "Payload for testing");
            BinaryCodec <Request> binCod = new BinaryCodec <Request>();

            byte[] reqCod = binCod.Encode(request);

            Request reqDecod = binCod.Decode(reqCod);

            Assert.AreEqual(request.Type, reqDecod.Type);
        }
コード例 #10
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _text))
     {
         return(false);
     }
     return(true);
 }
コード例 #11
0
        public void TestMethod4()
        {
            string imageBase64 = "iVBORw0KGgoAAAANSUhEUgAAAR8AAACwCAMAAAABtJrwAAAAkFBMVEX+/v7t7e3////s7OwAAAD29vbv7+/5+fnz8/P8/Pzx8fHk5OTn5+d2dnbi4uLf39/Hx8fa2tqAgIBsbGwMDAwPDw/Ozs7W1tYjIyOMjIwVFRWjo6MwMDA2NjY7Ozu3t7fAwMAbGxskJCSlpaVYWFhOTk6urq6bm5tbW1tFRUW6urpwcHBlZWWEhIR7e3tKSkocbt6vAAAX9klEQVR4nO1d6WKyOhCFIAECCrhAcUVBcAH7/m93k0xY3NHWSr/e/JJ6msAxmcyWQUISbUhSZNZ0uFL5haLBFYGrPwnEEjTjGKkAkn+FcK3LvwaU/+fnf37+5+eF/NSRygkSrrBy1uWfAcqSAQ0T2rAOlypcafxCInAl/UUgkRTeMOJNgysVrnS4kuDqbwIlWGYYJpwGU0yFKabDWjVgQSp/ESj9z8///PzPzyv5YV8qgEQnSLgy4Er5k0BJhwa7mgYXqsabKr6Cptev1L8CLLcxb7HY+TpcqbDFaXCF4UoA4eLPAMUqk+zN8mOapaEJSD7F2qLkt8D+Qotlh7YRpWinUE0St+km28DPbtWBNpwOgp1tKhi35iZbwI/U++xUbbY5LPweFiL87Tf5XvtdyOdD56hN1/1CXL9fSL4PKEsqNM1ZHhNEF9o62HlE/duN6oesYaR+ds7a8OMziBwD5pgigLy11Nr+fmBpXxjBOT+conUQmaqBUAH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maVH6UBbfssjuNNP4jcoka1xDxh+FuG/s38sMwlS1VN1/d8z1SUVxRi/8X8KMwRUr36+TVDtym+3Eag3KC+6J9u784/bDuw/fbFW4G/wP5qIz/QSYNXrv3rQEmCfUy8BgZ8TydF4MURKPlPAv8DVAkYTe1prMwAAAAASUVORK5CYII=";

            Image image = new Image("Name", "C:\\Users\\Desktop Javier\\Desktop\\TestMoto.png", imageBase64);
            BinaryCodec <Image> binCod = new BinaryCodec <Image>();

            byte[] imCod = binCod.Encode(image);

            Image imageDecod = binCod.Decode(imCod);

            Assert.AreEqual(image.FileBase64, imageDecod.FileBase64);
        }
        public void TestMethod5()
        {
            Image[]   images               = Array.Empty <Image>();
            Dashboard dashboard            = new Dashboard("Test dashboard", images);
            BinaryCodec <Dashboard> binCod = new BinaryCodec <Dashboard>();

            byte[] dashCod = binCod.Encode(dashboard);

            Dashboard dashDecod = binCod.Decode(dashCod);

            for (int i = 0; i < images.Length; i++)
            {
                Assert.AreEqual(dashboard.Images[i].Title, dashDecod.Images[i].Title);
            }
        }
        public void TestMethod2()
        {
            Image[] images = new Image[3];
            for (int i = 0; i < 3; i++)
            {
                Image image = new Image("Name-" + i, "C:\\Users\\Desktop Javier\\Desktop\\TestFoto.png");
                images[i] = image;
            }
            Dashboard dashboard            = new Dashboard("", images);
            BinaryCodec <Dashboard> binCod = new BinaryCodec <Dashboard>();

            byte[] dashCod = binCod.Encode(dashboard);

            Dashboard dashDecod = binCod.Decode(dashCod);

            Assert.AreEqual(dashboard.Name, dashDecod.Name);
        }
コード例 #14
0
ファイル: DB_Resource.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _assetName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _spriteName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _numIndex))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _numX))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _numY))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _objType = (E_ObjectType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _option))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _subPath))
     {
         return(false);
     }
     return(true);
 }
コード例 #15
0
 public bool Decode(BinaryDecoder decoder)
 {
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         chapter1.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_StoreBoard item = new DB_StoreBoard();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             chapter1.Add(item);
         }
     }
     return(true);
 }
コード例 #16
0
 public bool Decode(BinaryDecoder decoder)
 {
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         items.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_UIText item = new DB_UIText();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             items.Add(item);
         }
     }
     return(true);
 }
コード例 #17
0
ファイル: DB_Map.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _autoTileType = (E_AutoTile)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _name))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _groupname))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _spriteindex))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _tileMaterial = (E_TileMaterial)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _option))
     {
         return(false);
     }
     return(true);
 }
コード例 #18
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _select))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _text))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _storysceneid))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _storyindexid))
     {
         return(false);
     }
     return(true);
 }
コード例 #19
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _itemID))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemDesc))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _iconName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _price))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _option))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _itemType = (E_ItemType)enumValue;
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _itemKindType = (E_ItemKindType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _isConsume))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _scopeType = (E_ScopeType)enumValue;
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _occasionType = (E_OccasionType)enumValue;
     }
     return(true);
 }
コード例 #20
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _statusEffectID))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _statusEffectType = (E_StatusEffectType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _iconName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _displayName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _description))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _percent))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _fix))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _elementType = (E_ElementType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _variance))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _isCritical))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _criticalProbability))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _vfxEffect))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _soundEffect))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _effectColor))
     {
         return(false);
     }
     return(true);
 }
コード例 #21
0
ファイル: DB_Character.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _ID))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _Name))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _CharacterType = (E_CharacterType)enumValue;
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _displayName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _spriteName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_str))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_dex))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_con))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_int))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_spr))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_wis))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_hp))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _default_mp))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _rewordXP))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _rewordGold))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _isDrop))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _dropList))
     {
         return(false);
     }
     return(true);
 }
コード例 #22
0
ファイル: DB_Map.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _tileMapType = (E_TileMap)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _name))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _displayName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _sizeX))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _sizeY))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _isFog))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _groupname))
     {
         return(false);
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         bgTileSets.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             string item = null;
             if (!BinaryCodec.Decode(decoder, out item))
             {
                 return(false);
             }
             bgTileSets.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         objectTileSets.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             string item = null;
             if (!BinaryCodec.Decode(decoder, out item))
             {
                 return(false);
             }
             objectTileSets.Add(item);
         }
     }
     return(true);
 }
コード例 #23
0
ファイル: DB_Map.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _id))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _name))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _tileMaterial = (E_TileMaterial)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _isMove))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _groupname))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _randomCount))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _isAutoTile))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _autoTileType = (E_AutoTile)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _subPath))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _spritePack))
     {
         return(false);
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         sprites.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             string item = null;
             if (!BinaryCodec.Decode(decoder, out item))
             {
                 return(false);
             }
             sprites.Add(item);
         }
     }
     return(true);
 }
コード例 #24
0
ファイル: DB_Resource.cs プロジェクト: yabos/SaveTheQueen
 public bool Decode(BinaryDecoder decoder)
 {
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         maps.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             maps.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         objects.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             objects.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         items.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             items.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         weapons.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             weapons.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         armors.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             armors.Add(item);
         }
     }
     {
         ushort _size = 0;
         if (!BinaryCodec.Decode(decoder, out _size))
         {
             return(false);
         }
         characters.Capacity = _size;
         for (int i = 0; i < _size; ++i)
         {
             DB_SpriteData item = new DB_SpriteData();
             if (!item.Decode(decoder))
             {
                 return(false);
             }
             characters.Add(item);
         }
     }
     return(true);
 }
コード例 #25
0
 public bool Decode(BinaryDecoder decoder)
 {
     if (!BinaryCodec.Decode(decoder, out _itemID))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemName))
     {
         return(false);
     }
     if (!BinaryCodec.DecodeUnicodeString(decoder, out _itemDesc))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _iconName))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _price))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _option))
     {
         return(false);
     }
     {
         int enumValue = 0;
         if (!BinaryCodec.Decode(decoder, out enumValue))
         {
             return(false);
         }
         _armorType = (E_ArmorType)enumValue;
     }
     if (!BinaryCodec.Decode(decoder, out _health))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _energy))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _healthRecover))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _energyRecover))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _physicalArmor))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalArmor))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _physicalAvoid))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalAvoid))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _physicalResistance))
     {
         return(false);
     }
     if (!BinaryCodec.Decode(decoder, out _elementalResistance))
     {
         return(false);
     }
     return(true);
 }