internal override Part ReadEntry(BinaryReaderEx br)
            {
                PartType type = br.GetEnum16 <PartType>(br.Position + 8);

                switch (type)
                {
                case PartType.MapPiece:
                    var mapPiece = new Part.MapPiece(br);
                    MapPieces.Add(mapPiece);
                    return(mapPiece);

                case PartType.Object:
                    var obj = new Part.Object(br);
                    Objects.Add(obj);
                    return(obj);

                case PartType.Collision:
                    var collision = new Part.Collision(br);
                    Collisions.Add(collision);
                    return(collision);

                case PartType.Navmesh:
                    var navmesh = new Part.Navmesh(br);
                    Navmeshes.Add(navmesh);
                    return(navmesh);

                case PartType.ConnectCollision:
                    var connectCollision = new Part.ConnectCollision(br);
                    ConnectCollisions.Add(connectCollision);
                    return(connectCollision);

                default:
                    throw new NotImplementedException($"Unimplemented part type: {type}");
                }
            }
Beispiel #2
0
            internal override Part ReadEntry(BinaryReaderEx br)
            {
                PartType type = br.GetEnum32 <PartType>(br.Position + 4);

                switch (type)
                {
                case PartType.MapPiece:
                    var mapPiece = new Part.MapPiece(br);
                    MapPieces.Add(mapPiece);
                    return(mapPiece);

                case PartType.Object:
                    var obj = new Part.Object(br);
                    Objects.Add(obj);
                    return(obj);

                case PartType.Enemy:
                    var enemy = new Part.Enemy(br);
                    Enemies.Add(enemy);
                    return(enemy);

                case PartType.Player:
                    var player = new Part.Player(br);
                    Players.Add(player);
                    return(player);

                case PartType.Collision:
                    var collision = new Part.Collision(br);
                    Collisions.Add(collision);
                    return(collision);

                case PartType.Navmesh:
                    var navmesh = new Part.Navmesh(br);
                    Navmeshes.Add(navmesh);
                    return(navmesh);

                case PartType.DummyObject:
                    var dummyObject = new Part.DummyObject(br);
                    DummyObjects.Add(dummyObject);
                    return(dummyObject);

                case PartType.DummyEnemy:
                    var dummyEnemy = new Part.DummyEnemy(br);
                    DummyEnemies.Add(dummyEnemy);
                    return(dummyEnemy);

                case PartType.ConnectCollision:
                    var connectCollision = new Part.ConnectCollision(br);
                    ConnectCollisions.Add(connectCollision);
                    return(connectCollision);

                default:
                    throw new NotImplementedException($"Unimplemented part type: {type}");
                }
            }