예제 #1
0
 public void CopyDesign(clsDroidDesign DroidTypeToCopy)
 {
     TemplateDroidType = DroidTypeToCopy.TemplateDroidType;
     Body = DroidTypeToCopy.Body;
     Propulsion = DroidTypeToCopy.Propulsion;
     TurretCount = DroidTypeToCopy.TurretCount;
     Turret1 = DroidTypeToCopy.Turret1;
     Turret2 = DroidTypeToCopy.Turret2;
     Turret3 = DroidTypeToCopy.Turret3;
 }
예제 #2
0
        public bool LoadParts(sLoadPartsArgs Args)
        {
            bool TurretConflict = default(bool);

            Body = Args.Body;
            Propulsion = Args.Propulsion;

            TurretConflict = false;
            if ( Args.Construct != null )
            {
                if ( Args.Construct.Code != "ZNULLCONSTRUCT" )
                {
                    if ( Turret1 != null )
                    {
                        TurretConflict = true;
                    }
                    TurretCount = (byte)1;
                    Turret1 = Args.Construct;
                }
            }
            if ( Args.Repair != null )
            {
                if ( Args.Repair.Code != "ZNULLREPAIR" )
                {
                    if ( Turret1 != null )
                    {
                        TurretConflict = true;
                    }
                    TurretCount = (byte)1;
                    Turret1 = Args.Repair;
                }
            }
            if ( Args.Brain != null )
            {
                if ( Args.Brain.Code != "ZNULLBRAIN" )
                {
                    if ( Turret1 != null )
                    {
                        TurretConflict = true;
                    }
                    TurretCount = (byte)1;
                    Turret1 = Args.Brain;
                }
            }
            if ( Args.Weapon1 != null )
            {
                bool UseWeapon = default(bool);
                if ( Turret1 != null )
                {
                    if ( Turret1.TurretType == clsTurret.enumTurretType.Brain )
                    {
                        UseWeapon = false;
                    }
                    else
                    {
                        UseWeapon = true;
                        TurretConflict = true;
                    }
                }
                else
                {
                    UseWeapon = true;
                }
                if ( UseWeapon )
                {
                    TurretCount = (byte)1;
                    Turret1 = Args.Weapon1;
                    if ( Args.Weapon2 != null )
                    {
                        Turret2 = Args.Weapon2;
                        TurretCount += (byte)1;
                        if ( Args.Weapon3 != null )
                        {
                            Turret3 = Args.Weapon3;
                            TurretCount += (byte)1;
                        }
                    }
                }
            }
            if ( Args.Sensor != null )
            {
                if ( Args.Sensor.Location == clsSensor.enumLocation.Turret )
                {
                    if ( Turret1 != null )
                    {
                        TurretConflict = true;
                    }
                    TurretCount = (byte)1;
                    Turret1 = Args.Sensor;
                }
            }
            UpdateAttachments();

            return !TurretConflict; //return if all is ok
        }
예제 #3
0
 public clsTurret FindOrCreateTurret(clsTurret.enumTurretType TurretType, string TurretCode)
 {
     switch ( TurretType )
     {
         case clsTurret.enumTurretType.Weapon:
             return FindOrCreateWeapon(TurretCode);
         case clsTurret.enumTurretType.Construct:
             return FindOrCreateConstruct(TurretCode);
         case clsTurret.enumTurretType.Repair:
             return FindOrCreateRepair(TurretCode);
         case clsTurret.enumTurretType.Sensor:
             return FindOrCreateSensor(TurretCode);
         case clsTurret.enumTurretType.Brain:
             return FindOrCreateBrain(TurretCode);
         case clsTurret.enumTurretType.ECM:
             return FindOrCreateECM(TurretCode);
         default:
             return null;
     }
 }