Esempio n. 1
0
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType);
            //-------------------------------------------
            // Initialize the Building Appearance here.

            //setExists(true);
            //setFlag(OBJECT_FLAG_JUSTCREATED, true);

            captureTime = -1000.0f;

            var buildingAppearanceType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

            appearance = new BuildingAppearance(buildingAppearanceType, this);

            objectClass = ObjectClass.BUILDING;
            //setFlag(OBJECT_FLAG_DAMAGED, true);

            BuildingType type = (BuildingType)objType;

            if (type.extentRadius > 0.0)
            {
            }
            //setTangible(true);

            tonnage    = type.baseTonnage;
            explDamage = type.explDmg;
            explRadius = type.explRad;

            curCV = maxCV = (short)type.startBR;

            //setFlag(OBJECT_FLAG_CANREFIT, type->canRefit);
            //setFlag(OBJECT_FLAG_MECHBAY, type->mechBay);

            //setTeamId(type.teamId, true);

            //if (type.sensorRange > -1.0 && getTeam())
            //    setSensorData(getTeam(), type->sensorRange, true);

            //setFlag(OBJECT_FLAG_CAPTURABLE, false);
            if (type.capturable)
            {
                //setFlag(OBJECT_FLAG_CAPTURABLE, true);

                //setRefitBuddy(0);

                if (type.DamageLevel == 0.0f)
                {
                    //-------------------------------------------------------
                    // We are already destroyed. Used for extraction markers.
                    //setTangible(false);
                    //setStatus(OBJECT_STATUS_DESTROYED);
                    //setFlag(OBJECT_FLAG_DAMAGED, true);
                }
            }
        }
Esempio n. 2
0
        public void Init(ObjectType objType, AppearanceTypeManager appearanceTypeManager)
        {
            base.Init(objType);
            if (((TerrainObjectType)objType).subType == (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_TREE)
            {
                var treeAppearType = appearanceTypeManager.GetAppearanceType(objType.Appearance);

                appearance = new TreeAppearance(treeAppearType, this);
            }
            else
            {
                var terrainObjectAppearType = appearanceTypeManager.GetAppearanceType(objType.Appearance);
                appearance = new BuildingAppearance(terrainObjectAppearType, this);
            }


            this.objectClass = ObjectClass.TERRAINOBJECT;

            switch (((TerrainObjectType)objType).subType)
            {
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_NONE:
                if (((TerrainObjectType)objType).DamageLevel == 0f)
                {
                    //--------------------------------------------------------
                    // We are already destroyed.  Used for extraction Markers
                    //setTangible(false);
                    //setStatus(OBJECT_STATUS_DESTROYED);
                }
                break;

            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_TREE:
                objectClass = ObjectClass.TREE;
                //setFlag(OBJECT_FLAG_DAMAGED, false);
                break;

            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_BRIDGE:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_FOREST:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_HEAVY:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_MEDIUM:
            case (int)TerrainObjectType.TerrainObjectSubType.TERROBJ_WALL_LIGHT:
                //setTangible(false);
                objectClass = ObjectClass.BRIDGE;
                break;
            }
        }