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; }
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; }
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; }