internal override Model ReadEntry(BinaryReaderEx br)
            {
                ModelType type = br.GetEnum32 <ModelType>(br.Position + 8);

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

                case ModelType.Object:
                    var obj = new Model.Object(br);
                    Objects.Add(obj);
                    return(obj);

                case ModelType.Enemy:
                    var enemy = new Model.Enemy(br);
                    Enemies.Add(enemy);
                    return(enemy);

                case ModelType.Player:
                    var player = new Model.Player(br);
                    Players.Add(player);
                    return(player);

                case ModelType.Collision:
                    var collision = new Model.Collision(br);
                    Collisions.Add(collision);
                    return(collision);

                default:
                    throw new NotImplementedException($"Unimplemented model type: {type}");
                }
            }
Beispiel #2
0
            internal override Model ReadEntry(BinaryReaderEx br)
            {
                ModelType type = br.GetEnum32 <ModelType>(br.Position + 8);

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

                case ModelType.Object:
                    var obj = new Model.Object(br);
                    Objects.Add(obj);
                    return(obj);

                case ModelType.Enemy:
                    var enemy = new Model.Enemy(br);
                    Enemies.Add(enemy);
                    return(enemy);

                // Potential from mistake in m36 :trashcat:
                case ModelType.Item:
                    var item = new Model.Item(br);
                    Items.Add(item);
                    return(item);

                case ModelType.Player:
                    var player = new Model.Player(br);
                    Players.Add(player);
                    return(player);

                case ModelType.Collision:
                    var collision = new Model.Collision(br);
                    Collisions.Add(collision);
                    return(collision);

                case ModelType.Navmesh:
                    var navmesh = new Model.Navmesh(br);
                    Navmeshes.Add(navmesh);
                    return(navmesh);

                case ModelType.Other:
                    var other = new Model.Other(br);
                    Others.Add(other);
                    return(other);

                default:
                    throw new NotImplementedException($"Unsupported model type: {type}");
                }
            }
            internal override Model ReadEntryBB(BinaryReaderEx br)
            {
                ModelType type = br.GetEnum32 <ModelType>(br.Position + 8);

                switch (type)
                {
                case ModelType.MapPiece:
                    var mapPiece = new Model.MapPiece(br, MSBVersion.MSBVersionBB);
                    MapPieces.Add(mapPiece);
                    return(mapPiece);

                case ModelType.Object:
                    var obj = new Model.Object(br, MSBVersion.MSBVersionBB);
                    Objects.Add(obj);
                    return(obj);

                case ModelType.Enemy:
                    var enemy = new Model.Enemy(br, MSBVersion.MSBVersionBB);
                    Enemies.Add(enemy);
                    return(enemy);

                case ModelType.Item:
                    var enemy2 = new Model.Enemy(br);
                    Enemies.Add(enemy2);
                    return(enemy2);

                case ModelType.Player:
                    var player = new Model.Player(br, MSBVersion.MSBVersionBB);
                    Players.Add(player);
                    return(player);

                case ModelType.Collision:
                    var collision = new Model.Collision(br, MSBVersion.MSBVersionBB);
                    Collisions.Add(collision);
                    return(collision);

                /*
                 * case ModelType.Other:
                 * var other = new Model.Other(br);
                 * Others.Add(other);
                 * return other;
                 */
                default:
                    return(null);

                    //throw new NotImplementedException($"Unsupported model type: {type}");
                }
            }