Esempio n. 1
0
        public override IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            base.Decode(stream);

            Data.Decode(stream);

            return(this);
        }
Esempio n. 2
0
        public virtual IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            this.id       = stream.ReadInt32();
            this.Position = stream.ReadVector2();
            this.Width    = stream.ReadInt32();
            this.Height   = stream.ReadInt32();

            return(this);
        }
Esempio n. 3
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            int count = stream.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                Templates.Add(stream.ReadObject <EntityTemplate>());
            }
            return(this);
        }
Esempio n. 4
0
        public override General.Common.IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            base.Decode(stream);
            this.MovementBehavior        = stream.ReadObject <MovementBehavior>();
            this.MovementBehavior.Entity = this;
            this.elapsed      = stream.ReadSingle();
            this.nextMovement = stream.ReadSingle();

            return(this);
        }
Esempio n. 5
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            int c = stream.ReadInt32();

            for (int i = 0; i < c; i++)
            {
                Add(stream.ReadRectangle());
            }
            return(this);
        }
Esempio n. 6
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            name = stream.ReadString();
            int      c      = stream.ReadInt32();
            ActionIO reader = new ActionIO(stream);

            for (int i = 0; i < c; i++)
            {
                Actions.Add(reader.Read());
            }

            return(this);
        }
Esempio n. 7
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            this.X = stream.ReadInt32();
            this.Y = stream.ReadInt32();
            this.Z = stream.ReadInt32();

            this.TilesetIndex = stream.ReadInt32();
            this.TileIndex    = stream.ReadInt32();

            this.oldtilesetIndex = stream.ReadInt32();
            this.oldtileIndex    = stream.ReadInt32();

            return(this);
        }
Esempio n. 8
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            position    = stream.ReadVector2();
            modelName   = stream.ReadString();
            entityIndex = stream.ReadInt32();

            if (!string.IsNullOrEmpty(modelName))
            {
                World world = EditorEngine.Instance.World;
                model = EditorEngine.Instance.GetModelByName(modelName);
            }

            EntityIO io = new EntityIO(stream, EditorEngine.Instance.CurrentMap.Factory, true);

            this.worldEntity = io.Read();

            return(this);
        }
Esempio n. 9
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            Name   = stream.ReadString();
            Author = stream.ReadString();
            Width  = stream.ReadInt32();
            Height = stream.ReadInt32();
            int c1 = stream.ReadInt32();

            for (int i = 0; i < c1; i++)
            {
                Tilesets.Add(stream.ReadObject <MockupTileset>());
            }

            /*Initialize Tiles jagged multidimensional array*/
            this.Tiles = new MockupTile[Width][][];
            for (int i = 0; i < Width; i++)
            {
                Tiles[i] = new MockupTile[Height][];
                for (int j = 0; j < Height; j++)
                {
                    Tiles[i][j] = new MockupTile[Map.LayerCount];
                }
            }

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    for (int z = 0; z < LayerCount; z++)
                    {
                        Tiles[x][y][z] = stream.ReadObject <MockupTile>();
                    }
                }
            }
            int c2 = stream.ReadInt32();

            for (int i = 0; i < c2; i++)
            {
                EntityTemplate e = stream.ReadObject <EntityTemplate>();
                Entities.Add(e.CreateEntity(World.EntityFactory));
            }
            return(this);
        }
Esempio n. 10
0
        public IEncodable Decode(General.Encoding.BinaryInput stream)
        {
            this.Name   = stream.ReadString();
            this.Gender = (Gender)stream.ReadInt32();

            int c = stream.ReadInt32();

            for (int i = 0; i < c; i++)
            {
                this.Party[i] = new Pokemon();
                this.Party[i].Decode(stream);
            }

            int cc = stream.ReadInt32();

            for (int i = 0; i < cc; i++)
            {
                Flags[i] = stream.ReadBoolean();
            }
            return(this);
        }
Esempio n. 11
0
 public IEncodable Decode(General.Encoding.BinaryInput stream)
 {
     tilesheetindex = stream.ReadInt32();
     return(this);
 }
Esempio n. 12
0
 public IEncodable Decode(General.Encoding.BinaryInput stream)
 {
     return(this);
 }