예제 #1
0
            internal override Model ReadEntry(BinaryReaderEx br)
            {
                ModelType type = br.GetEnum32 <ModelType>(br.Position + 4);

                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.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.DummyObject:
                    return(DummyObjects.EchoAdd(new Model.DummyObject(br)));

                case ModelType.DummyEnemy:
                    return(DummyEnemies.EchoAdd(new Model.DummyEnemy(br)));

                default:
                    throw new NotImplementedException($"Unimplemented model type: {type}");
                }
            }
예제 #2
0
            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}");
                }
            }