/// <summary>
            /// Adds a region to the appropriate list for its type; returns the region.
            /// </summary>
            public Region Add(Region region)
            {
                switch (region)
                {
                case Region.Region0 r: Region0s.Add(r); break;

                case Region.Light r: Lights.Add(r); break;

                case Region.StartPoint r: StartPoints.Add(r); break;

                case Region.Sound r: Sounds.Add(r); break;

                case Region.SFX r: SFXs.Add(r); break;

                case Region.Wind r: Winds.Add(r); break;

                case Region.EnvLight r: EnvLights.Add(r); break;

                case Region.Fog r: Fogs.Add(r); break;

                default:
                    throw new ArgumentException($"Unrecognized type {region.GetType()}.", nameof(region));
                }
                return(region);
            }
Beispiel #2
0
            internal override Region ReadEntry(BinaryReaderEx br)
            {
                RegionType type = br.GetEnum8 <RegionType>(br.Position + 0xA);

                switch (type)
                {
                case RegionType.Region0:
                    var region0 = new Region.Region0(br);
                    Region0s.Add(region0);
                    return(region0);

                case RegionType.Light:
                    var light = new Region.Light(br);
                    Lights.Add(light);
                    return(light);

                case RegionType.StartPoint:
                    var startPoint = new Region.StartPoint(br);
                    StartPoints.Add(startPoint);
                    return(startPoint);

                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.Wind:
                    var wind = new Region.Wind(br);
                    Winds.Add(wind);
                    return(wind);

                case RegionType.EnvLight:
                    var envLight = new Region.EnvLight(br);
                    EnvLights.Add(envLight);
                    return(envLight);

                case RegionType.Fog:
                    var fog = new Region.Fog(br);
                    Fogs.Add(fog);
                    return(fog);

                default:
                    throw new NotImplementedException($"Unimplemented region type: {type}");
                }
            }
Beispiel #3
0
            public void Add(IMsbRegion item)
            {
                switch (item)
                {
                case Region.Region0 r:
                    Region0s.Add(r);
                    break;

                case Region.Light r:
                    Lights.Add(r);
                    break;

                case Region.StartPoint r:
                    StartPoints.Add(r);
                    break;

                case Region.Sound r:
                    Sounds.Add(r);
                    break;

                case Region.SFX r:
                    SFXs.Add(r);
                    break;

                case Region.Wind r:
                    Winds.Add(r);
                    break;

                case Region.EnvLight r:
                    EnvLights.Add(r);
                    break;

                case Region.Fog r:
                    Fogs.Add(r);
                    break;

                default:
                    throw new ArgumentException(
                              message: "Item is not recognized",
                              paramName: nameof(item));
                }
            }
Beispiel #4
0
        //敵オブジェクト配置
        void CreateObject(asd.Vector2DF position, int obj)
        {
            switch (obj)
            {
            case 0:
                Walls.Add(new Wall(position));
                LayerOfMain.AddObject(Walls[Walls.Count - 1]);
                SetWallRainColligeData(Walls[Walls.Count - 1].Position);
                break;

            case 1:
                Clouds.Add(new Cloud(position, TypeOfCloud.Small));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 2:
                Clouds.Add(new Cloud(position, TypeOfCloud.Medium));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 3:
                Clouds.Add(new Cloud(position, TypeOfCloud.Large));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 4:
                break;

            case 5:
                Healers.Add(new Healer(position));
                LayerOfMain.AddObject(Healers[Healers.Count - 1]);
                break;

            case 6:
                Winds.Add(new Wind(position));
                LayerOfMain.AddObject(Winds[Winds.Count - 1]);
                break;
            }
        }