Beispiel #1
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;
		}
Beispiel #2
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;
		}
Beispiel #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;
		}
Beispiel #4
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;
		}
Beispiel #5
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;
		}
Beispiel #6
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;
		}
Beispiel #7
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;
		}
Beispiel #8
0
		public IEncodable Decode(General.Encoding.BinaryInput stream) {
			index = stream.ReadInt32();
			return this;
		}