예제 #1
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;
		}
예제 #2
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;
		}
예제 #3
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;
		}
예제 #4
0
파일: Map.cs 프로젝트: Hakua/PokeSharp
		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;
		}