internal override Model ReadEntry(BinaryReaderEx br) { ModelType type = br.GetEnum32 <ModelType>(br.Position + 8); switch (type) { case ModelType.MapPiece: return(MapPieces.EchoAdd(new Model.MapPiece(br))); case ModelType.Object: return(Objects.EchoAdd(new Model.Object(br))); case ModelType.Enemy: return(Enemies.EchoAdd(new Model.Enemy(br))); case ModelType.Item: return(Items.EchoAdd(new Model.Item(br))); case ModelType.Player: return(Players.EchoAdd(new Model.Player(br))); case ModelType.Collision: return(Collisions.EchoAdd(new Model.Collision(br))); case ModelType.Navmesh: return(Navmeshes.EchoAdd(new Model.Navmesh(br))); case ModelType.Other: return(Others.EchoAdd(new Model.Other(br))); default: throw new NotImplementedException($"Unimplemented model type: {type}"); } }
internal override Part ReadEntry(BinaryReaderEx br) { PartType type = br.GetEnum8 <PartType>(br.Position + br.VarintSize); switch (type) { case PartType.MapPiece: return(MapPieces.EchoAdd(new Part.MapPiece(br))); case PartType.Object: return(Objects.EchoAdd(new Part.Object(br))); case PartType.Collision: return(Collisions.EchoAdd(new Part.Collision(br))); case PartType.Navmesh: return(Navmeshes.EchoAdd(new Part.Navmesh(br))); case PartType.ConnectCollision: return(ConnectCollisions.EchoAdd(new Part.ConnectCollision(br))); default: throw new NotImplementedException($"Unimplemented part type: {type}"); } }
internal override Event ReadEntry(BinaryReaderEx br) { EventType type = br.GetEnum32 <EventType>(br.Position + 8); switch (type) { case EventType.Light: return(Lights.EchoAdd(new Event.Light(br))); case EventType.Sound: return(Sounds.EchoAdd(new Event.Sound(br))); case EventType.SFX: return(SFX.EchoAdd(new Event.SFX(br))); case EventType.Wind: return(Wind.EchoAdd(new Event.Wind(br))); case EventType.Treasure: return(Treasures.EchoAdd(new Event.Treasure(br))); case EventType.Generator: return(Generators.EchoAdd(new Event.Generator(br))); case EventType.Message: return(Messages.EchoAdd(new Event.Message(br))); case EventType.ObjAct: return(ObjActs.EchoAdd(new Event.ObjAct(br))); case EventType.SpawnPoint: return(SpawnPoints.EchoAdd(new Event.SpawnPoint(br))); case EventType.MapOffset: return(MapOffsets.EchoAdd(new Event.MapOffset(br))); case EventType.Navmesh: return(Navmeshes.EchoAdd(new Event.Navmesh(br))); case EventType.Environment: return(Environments.EchoAdd(new Event.Environment(br))); case EventType.PseudoMultiplayer: return(PseudoMultiplayers.EchoAdd(new Event.PseudoMultiplayer(br))); default: throw new NotImplementedException($"Unsupported event type: {type}"); } }
internal override Part ReadEntry(BinaryReaderEx br) { PartType type = br.GetEnum32 <PartType>(br.Position + 4); switch (type) { case PartType.MapPiece: return(MapPieces.EchoAdd(new Part.MapPiece(br))); case PartType.Object: return(Objects.EchoAdd(new Part.Object(br))); case PartType.Enemy: return(Enemies.EchoAdd(new Part.Enemy(br))); case PartType.Player: return(Players.EchoAdd(new Part.Player(br))); case PartType.Collision: return(Collisions.EchoAdd(new Part.Collision(br))); case PartType.Protoboss: return(Protobosses.EchoAdd(new Part.Protoboss(br))); case PartType.Navmesh: return(Navmeshes.EchoAdd(new Part.Navmesh(br))); case PartType.DummyObject: return(DummyObjects.EchoAdd(new Part.DummyObject(br))); case PartType.DummyEnemy: return(DummyEnemies.EchoAdd(new Part.DummyEnemy(br))); case PartType.ConnectCollision: return(ConnectCollisions.EchoAdd(new Part.ConnectCollision(br))); default: throw new NotImplementedException($"Unimplemented part type: {type}"); } }