예제 #1
0
 private void InitializeDeckFlag(ShipModel shipModel)
 {
     if (IsDeckInShip(shipModel))
     {
         DeckModelBase deck       = shipModel.getDeck();
         bool          isFlagShip = deck.GetFlagShip().MemId == shipModel.MemId;
         int           id         = deck.Id;
         if (deck.IsEscortDeckMyself())
         {
             InitializeEscortDeckFlag(id, isFlagShip);
         }
         else
         {
             InitializeNormalDeckFlag(id, isFlagShip);
         }
     }
     else if (shipModel.IsBling())
     {
         BlingDeckFlag();
     }
     else
     {
         RemoveDeckFlag();
     }
 }
    private void InitializeDeckFlag(ShipModel shipModel)
    {
        bool flag = this.IsDeckInShip(shipModel);

        if (flag)
        {
            DeckModelBase deck       = shipModel.getDeck();
            bool          isFlagShip = deck.GetFlagShip().MemId == shipModel.MemId;
            int           id         = deck.Id;
            bool          flag2      = deck.IsEscortDeckMyself();
            if (flag2)
            {
                this.InitializeEscortDeckFlag(id, isFlagShip);
            }
            else
            {
                this.InitializeNormalDeckFlag(id, isFlagShip);
            }
        }
        else if (shipModel.IsBling())
        {
            this.BlingDeckFlag();
        }
        else
        {
            this.RemoveDeckFlag();
        }
    }
예제 #3
0
        public bool IsValidShip(int ship_mem_id)
        {
            ShipModel ship = base.UserInfo.GetShip(ship_mem_id);

            if (ship.IsBling())
            {
                return(false);
            }
            if (ship.IsInMission())
            {
                return(false);
            }
            DeckModelBase deck = ship.getDeck();

            if (deck != null)
            {
                if (deck.IsEscortDeckMyself())
                {
                    return(false);
                }
                if (deck.IsActionEnd())
                {
                    return(false);
                }
            }
            return(true);
        }
예제 #4
0
        public bool IsValidStartRepair(int ship_mem_id, bool use_repairkit)
        {
            ShipModel shipModel = _ships.Find((ShipModel x) => x.MemId == ship_mem_id);

            if (shipModel == null)
            {
                return(false);
            }
            if (shipModel.TaikyuRate >= 100.0)
            {
                return(false);
            }
            if (shipModel.IsInMission() || shipModel.IsInRepair())
            {
                return(false);
            }
            if (shipModel.IsBling())
            {
                return(false);
            }
            if (shipModel.IsBlingWaitFromEscortDeck())
            {
                return(false);
            }
            MaterialInfo resourcesForRepair = shipModel.GetResourcesForRepair();

            if (base.Material.Fuel < resourcesForRepair.Fuel)
            {
                return(false);
            }
            if (base.Material.Steel < resourcesForRepair.Steel)
            {
                return(false);
            }
            if (use_repairkit && base.Material.RepairKit < 1)
            {
                return(false);
            }
            DeckModelBase deck = shipModel.getDeck();

            if (deck != null)
            {
                if (deck.IsEscortDeckMyself())
                {
                    return(false);
                }
                return(deck.AreaId == MapArea.Id);
            }
            if (shipModel.IsBlingWaitFromDeck() && shipModel.AreaIdBeforeBlingWait == MapArea.Id)
            {
                return(true);
            }
            if (MapArea.Id == 1)
            {
                return(true);
            }
            return(false);
        }
    protected override bool IsDeckInShip(ShipModel shipModel)
    {
        DeckModelBase deck  = shipModel.getDeck();
        bool          flag  = deck != null && !deck.IsEscortDeckMyself();
        bool          flag2 = false;

        ShipModel[] ships = EscortOrganizeTaskManager.GetEscortManager().EditDeck.GetShips();
        ShipModel[] array = ships;
        foreach (ShipModel shipModel2 in array)
        {
            if (shipModel2.MemId == shipModel.MemId)
            {
                flag2 = true;
                break;
            }
        }
        return(flag || flag2);
    }
예제 #6
0
    protected override bool IsDeckInShip(ShipModel shipModel)
    {
        DeckModelBase deck  = shipModel.getDeck();
        bool          flag  = deck != null;
        bool          flag2 = flag && !deck.IsEscortDeckMyself();
        bool          flag3 = false;

        ShipModel[] ships = EscortOrganizeTaskManager.GetEscortManager().EditDeck.GetShips();
        ShipModel[] array = ships;
        for (int i = 0; i < array.Length; i++)
        {
            ShipModel shipModel2 = array[i];
            if (shipModel2.MemId == shipModel.MemId)
            {
                flag3 = true;
                break;
            }
        }
        return(flag2 || flag3);
    }
예제 #7
0
        public bool IsValidShip(int ship_mem_id)
        {
            ShipModel ship = base.UserInfo.GetShip(ship_mem_id);

            if (ship.IsBling())
            {
                return(false);
            }
            DeckModelBase deck = ship.getDeck();

            if (deck != null)
            {
                if (deck.AreaId != MapArea.Id)
                {
                    return(false);
                }
                if (!deck.IsEscortDeckMyself())
                {
                    return(false);
                }
            }
            return(_edit_deck.HasShipMemId(ship_mem_id));
        }