internal override Event ReadEntry(BinaryReaderEx br) { EventType type = br.GetEnum32 <EventType>(br.Position + 0xC); switch (type) { 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.ObjAct: var objAct = new Event.ObjAct(br); ObjActs.Add(objAct); return(objAct); case EventType.MapOffset: var mapOffset = new Event.MapOffset(br); MapOffsets.Add(mapOffset); return(mapOffset); case EventType.WalkRoute: var walkRoute = new Event.WalkRoute(br); WalkRoutes.Add(walkRoute); return(walkRoute); case EventType.GroupTour: var groupTour = new Event.GroupTour(br); GroupTours.Add(groupTour); return(groupTour); case EventType.Event17: var event17 = new Event.Event17(br); Event17s.Add(event17); return(event17); case EventType.Event18: var event18 = new Event.Event18(br); Event18s.Add(event18); return(event18); case EventType.Event20: var event20 = new Event.Event20(br); Event20s.Add(event20); return(event20); case EventType.Event21: var event21 = new Event.Event21(br); Event21s.Add(event21); return(event21); case EventType.PartsGroup: var partsGroup = new Event.PartsGroup(br); PartsGroups.Add(partsGroup); return(partsGroup); case EventType.Event23: var event23 = new Event.Event23(br); Event23s.Add(event23); return(event23); case EventType.AutoDrawGroup: var autoDrawGroup = new Event.AutoDrawGroup(br); AutoDrawGroups.Add(autoDrawGroup); return(autoDrawGroup); case EventType.Other: var other = new Event.Other(br); Others.Add(other); return(other); default: throw new NotImplementedException($"Unimplemented model type: {type}"); } }
internal override Region ReadEntry(BinaryReaderEx br) { RegionType type = br.GetEnum32 <RegionType>(br.Position + 8); switch (type) { case RegionType.Region0: var region0 = new Region.Region0(br); Region0s.Add(region0); return(region0); case RegionType.InvasionPoint: var invasionPoint = new Region.InvasionPoint(br); InvasionPoints.Add(invasionPoint); return(invasionPoint); case RegionType.EnvironmentMapPoint: var environmentMapPoint = new Region.EnvironmentMapPoint(br); EnvironmentMapPoints.Add(environmentMapPoint); return(environmentMapPoint); case RegionType.Sound: var sound = new Region.Sound(br); Sounds.Add(sound); return(sound); case RegionType.SFX: var sfx = new Region.SFX(br); SFXs.Add(sfx); return(sfx); case RegionType.WindSFX: var windSFX = new Region.WindSFX(br); WindSFXs.Add(windSFX); return(windSFX); case RegionType.SpawnPoint: var spawnPoint = new Region.SpawnPoint(br); SpawnPoints.Add(spawnPoint); return(spawnPoint); case RegionType.WalkRoute: var walkRoute = new Region.WalkRoute(br); WalkRoutes.Add(walkRoute); return(walkRoute); case RegionType.WarpPoint: var warpPoint = new Region.WarpPoint(br); WarpPoints.Add(warpPoint); return(warpPoint); case RegionType.ActivationArea: var activationArea = new Region.ActivationArea(br); ActivationAreas.Add(activationArea); return(activationArea); case RegionType.Event: var evt = new Region.Event(br); Events.Add(evt); return(evt); case RegionType.EnvironmentMapEffectBox: var environmentMapEffectBox = new Region.EnvironmentMapEffectBox(br); EnvironmentMapEffectBoxes.Add(environmentMapEffectBox); return(environmentMapEffectBox); case RegionType.WindArea: var windArea = new Region.WindArea(br); WindAreas.Add(windArea); return(windArea); case RegionType.MufflingBox: var mufflingBox = new Region.MufflingBox(br); MufflingBoxes.Add(mufflingBox); return(mufflingBox); case RegionType.MufflingPortal: var mufflingPortal = new Region.MufflingPortal(br); MufflingPortals.Add(mufflingPortal); return(mufflingPortal); case RegionType.Region23: var region23 = new Region.Region23(br); Region23s.Add(region23); return(region23); case RegionType.Region24: var region24 = new Region.Region24(br); Region24s.Add(region24); return(region24); case RegionType.PartsGroup: var partsGroup = new Region.PartsGroup(br); PartsGroups.Add(partsGroup); return(partsGroup); case RegionType.AutoDrawGroup: var autoDrawGroup = new Region.AutoDrawGroup(br); AutoDrawGroups.Add(autoDrawGroup); return(autoDrawGroup); case RegionType.Other: var other = new Region.Other(br); Others.Add(other); return(other); default: throw new NotImplementedException($"Unimplemented region type: {type}"); } }