Exemplo n.º 1
0
    private static ArcType ArcToSector(GenericArc arc)
    {
        switch (arc.Facing)
        {
        case ArcFacing.Front:
            return(ArcType.Front);

        case ArcFacing.Left:
            return(ArcType.Left);

        case ArcFacing.Right:
            return(ArcType.Right);

        case ArcFacing.Rear:
            return(ArcType.Rear);

        case ArcFacing.FullFront:
            return(ArcType.FullFront);

        case ArcFacing.FullRear:
            return(ArcType.FullRear);

        case ArcFacing.Bullseye:
            return(ArcType.Bullseye);

        default:
            return(ArcType.None);
        }
    }
Exemplo n.º 2
0
        public bool IsShipInSector(GenericShip anotherShip, ArcType arcType)
        {
            GenericArc  arc     = Arcs.First(n => n.ArcType == arcType);
            ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc);

            return(arcInfo.IsShotAvailable);
        }
Exemplo n.º 3
0
        public int RangeToShipBySector(GenericShip anotherShip, ArcType arcType)
        {
            GenericArc  arc     = Arcs.First(n => n.ArcType == arcType);
            ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc);

            return(arcInfo.Range);
        }
Exemplo n.º 4
0
        private void InitializeShipBaseArc()
        {
            switch (ShipBaseArcsType)
            {
            case BaseArcsType.ArcDefault:
                ArcInfo = new GenericArc(this);
                break;

            case BaseArcsType.ArcRear:
                ArcInfo = new ArcRear(this);
                break;

            case BaseArcsType.Arc180:
                ArcInfo = new Arc180(this);
                break;

            case BaseArcsType.Arc360:
                ArcInfo = new Arc360(this);
                break;

            case BaseArcsType.ArcMobile:
                ArcInfo = new ArcMobile(this);
                break;

            default:
                break;
            }
        }
Exemplo n.º 5
0
 private static void SetArcAsUsedForAttack()
 {
     Combat.ArcForShot = Combat.ShotInfo.ShotAvailableFromArcs.FirstOrDefault();
     if (ArcForShot != null)
     {
         ArcForShot.WasUsedForAttackThisRound = true;
     }
 }
Exemplo n.º 6
0
        public ShotInfoArc(GenericShip ship1, GenericShip ship2, GenericArc arc, IShipWeapon weapon) : base(ship1, ship2)
        {
            Weapon = weapon ?? ship1.PrimaryWeapons.First();

            Arc = arc;

            CheckRange();
        }
Exemplo n.º 7
0
        private void ToggleAbility(bool isActive)
        {
            GenericArc rearArc = HostShip.ArcInfo.GetArc <ArcRear>();

            rearArc.ShotPermissions.CanShootCannon    = isActive;
            rearArc.ShotPermissions.CanShootTorpedoes = isActive;
            rearArc.ShotPermissions.CanShootMissiles  = isActive;
        }
Exemplo n.º 8
0
 private static void CleanupCombatData()
 {
     AttackStep            = CombatStep.None;
     Attacker              = null;
     Defender              = null;
     ChosenWeapon          = null;
     ShotInfo              = null;
     ArcForShot            = null;
     hitsCounter           = 0;
     ExtraAttackFilter     = null;
     IsAttackAlreadyCalled = false;
 }
Exemplo n.º 9
0
        public ShotInfoArc GetSectorInfo(GenericShip anotherShip, ArcType arcType)
        {
            GenericArc arc = Arcs.FirstOrDefault(n => n.ArcType == arcType);

            if (arc != null)
            {
                return(new ShotInfoArc(HostShip, anotherShip, arc));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 10
0
        public bool IsShipInSector(GenericShip anotherShip, ArcType arcType)
        {
            GenericArc  arc     = Arcs.First(n => n.ArcType == arcType);
            ShotInfoArc arcInfo = new ShotInfoArc(HostShip, anotherShip, arc);

            bool result = arcInfo.IsShotAvailable;

            if (arcType == ArcType.Bullseye)
            {
                HostShip.CallOnBullseyeArcCheck(anotherShip, ref result);
            }

            return(result);
        }
Exemplo n.º 11
0
        public ShotInfoArc(GenericShip ship1, GenericShip ship2, GenericArc arc) : base(ship1, ship2)
        {
            Arc = arc;

            CheckRange();
        }
Exemplo n.º 12
0
 public virtual void RotateMobileFiringArcAlt(GenericArc arc, ArcFacing facing)
 {
 }