Beispiel #1
0
        public virtual int Size()
        {
            int nSize = 0;

            try {
                nSize += ErrorCode_Serializer.Size(error_code);
                nSize += sizeof(int);
                nSize += sizeof(int);
                nSize += sizeof(int);
                foreach (var tiles_itr in tiles)
                {
                    DungeonTileType tiles_elmt = tiles_itr;
                    nSize += DungeonTileType_Serializer.Size(tiles_elmt);
                }
                nSize += sizeof(ulong);
                nSize += Vector2Int_Serializer.Size(position);
                nSize += sizeof(int);
                foreach (var comrades_itr in comrades)
                {
                    Player comrades_elmt = comrades_itr;
                    nSize += Player_Serializer.Size(comrades_elmt);
                }
                nSize += sizeof(int);
                foreach (var enemies_itr in enemies)
                {
                    Monster enemies_elmt = enemies_itr;
                    nSize += Monster_Serializer.Size(enemies_elmt);
                }
            } catch (System.Exception) {
                return(-1);
            }
            return(nSize);
        }
Beispiel #2
0
        public virtual int Size()
        {
            int nSize = 0;

            try {
                nSize += Vector2Int_Serializer.Size(destination);
            } catch (System.Exception) {
                return(-1);
            }
            return(nSize);
        }
Beispiel #3
0
        public virtual int Size()
        {
            int nSize = 0;

            try {
                nSize += sizeof(ulong);
                nSize += Vector2Int_Serializer.Size(position);
            } catch (System.Exception) {
                return(-1);
            }
            return(nSize);
        }