Example #1
0
 public ISerializable Deserialize(BinaryInput input)
 {
     Name = input.ReadString();
     TimePerFrame = input.ReadSingle();
     Frames = input.ReadList<KeyFrame>();
     AnimationFlag = (AnimationFlags) input.ReadByte();
     FlipEffect = (SpriteEffects) input.ReadByte();
     Rotation = input.ReadSingle();
     return this;
 }
Example #2
0
        public IEncodable Decode(BinaryInput stream)
        {
            this.Name   = stream.ReadString();
            this.Author = stream.ReadString();

            this.Width  = stream.ReadInt32();
            this.Height = stream.ReadInt32();

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

            int w = Width;
            int h = Height;

            this.Tilesets = stream.ReadList <MockupTileset>();

            for (int i = 0; i < w; i++)
            {
                for (int j = 0; j < h; j++)
                {
                    for (int k = 0; k < Map.LayerCount; k++)
                    {
                        Tiles[i][j][k] = stream.ReadObject <MockupTile>();
                    }
                }
            }

            int c = stream.ReadInt32();

            for (int i = 0; i < c; i++)
            {
                Tuple <Int32, Vector2> t = new Tuple <Int32, Vector2>(stream.ReadInt32(), stream.ReadVector2());
                Entities.Add(t);
            }
            return(this);
        }
Example #3
0
		public IEncodable Decode(BinaryInput stream) {
			this.Name = stream.ReadString();
			this.Author = stream.ReadString();

			this.Width = stream.ReadInt32();
			this.Height = stream.ReadInt32();

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

			int w = Width;
			int h = Height;

			this.Tilesets = stream.ReadList<MockupTileset>();

			for (int i = 0; i < w; i++) {
				for (int j = 0; j < h; j++) {
					for (int k = 0; k < Map.LayerCount; k++) {
						Tiles[i][j][k] = stream.ReadObject<MockupTile>();
					}
				}
			}

			int c = stream.ReadInt32();
			for (int i = 0; i < c; i++) {
				Tuple<Int32, Vector2> t = new Tuple<Int32, Vector2>(stream.ReadInt32(), stream.ReadVector2());
				Entities.Add(t);
			}
			return this;
		}
Example #4
0
        public ISerializable Deserialize(BinaryInput input)
        {
            Name = input.ReadString();

            int tilesetCount = input.ReadInt32();
            Tilesets = new Dictionary<int, Tileset>(tilesetCount);

            for (var i = 0; i < tilesetCount; i++)
            {
                int key = input.ReadInt32();
                var value = input.ReadObject<Tileset>();
                Tilesets.Add(key, value);
            }

            Layers = input.ReadList<Layer>();
            for (var i = 0; i < Layers.Count; i++)
            {
                Layers[i].Map = this;
            }
            return this;
        }