internal override Event ReadEntry(BinaryReaderEx br) { EventType type = br.GetEnum16 <EventType>(br.Position + 0xC); switch (type) { case EventType.Light: var light = new Event.Light(br); Lights.Add(light); return(light); case EventType.Shadow: var shadow = new Event.Shadow(br); Shadows.Add(shadow); return(shadow); case EventType.Fog: var fog = new Event.Fog(br); Fogs.Add(fog); return(fog); case EventType.BGColor: var bgColor = new Event.BGColor(br); BGColors.Add(bgColor); return(bgColor); case EventType.MapOffset: var mapOffset = new Event.MapOffset(br); MapOffsets.Add(mapOffset); return(mapOffset); case EventType.Warp: var warp = new Event.Warp(br); Warps.Add(warp); return(warp); case EventType.CheapMode: var cheapMode = new Event.CheapMode(br); CheapModes.Add(cheapMode); return(cheapMode); default: throw new NotImplementedException($"Unimplemented event type: {type}"); } }
internal override Event ReadEntry(BinaryReaderEx br) { EventType type = br.GetEnum32 <EventType>(br.Position + 8); switch (type) { case EventType.Light: var light = new Event.Light(br); Lights.Add(light); return(light); case EventType.Sound: var sound = new Event.Sound(br); Sounds.Add(sound); return(sound); case EventType.SFX: var sfx = new Event.SFX(br); SFXs.Add(sfx); return(sfx); case EventType.WindSFX: var windSFX = new Event.WindSFX(br); WindSFXs.Add(windSFX); return(windSFX); case EventType.Treasure: var treasure = new Event.Treasure(br); Treasures.Add(treasure); return(treasure); case EventType.Generator: var generator = new Event.Generator(br); Generators.Add(generator); return(generator); case EventType.Message: var message = new Event.Message(br); Messages.Add(message); return(message); case EventType.ObjAct: var objAct = new Event.ObjAct(br); ObjActs.Add(objAct); return(objAct); case EventType.SpawnPoint: var spawnPoint = new Event.SpawnPoint(br); SpawnPoints.Add(spawnPoint); return(spawnPoint); case EventType.MapOffset: var mapOffset = new Event.MapOffset(br); MapOffsets.Add(mapOffset); return(mapOffset); case EventType.Navmesh: var navmesh = new Event.Navmesh(br); Navmeshes.Add(navmesh); return(navmesh); case EventType.Environment: var environment = new Event.Environment(br); Environments.Add(environment); return(environment); case EventType.PseudoMultiplayer: var pseudoMultiplayer = new Event.PseudoMultiplayer(br); PseudoMultiplayers.Add(pseudoMultiplayer); return(pseudoMultiplayer); default: throw new NotImplementedException($"Unsupported event type: {type}"); } }