コード例 #1
0
 public void RemoveItemFromBackpack(GearItem item)
 {
     if (item != null && Backpack.Contains(item))
     {
         Backpack.Remove(item);
     }
 }
コード例 #2
0
 public void AddItemToBackpack(GearItem item)
 {
     if (item != null)
     {
         Backpack.Add(item);
     }
 }
コード例 #3
0
ファイル: FishingRod.cs プロジェクト: Stanis47/ConsoleFishing
        public void InstallLure(GearItem lure)
        {
            if (lure.Category != ItemCategory.Lure)
            {
                throw new ArgumentException("Category must be Lure");
            }

            CurrentLure = lure;
        }
コード例 #4
0
ファイル: FishingRod.cs プロジェクト: Stanis47/ConsoleFishing
        public void InstallHook(GearItem hook)
        {
            if (hook.Category != ItemCategory.Hook)
            {
                throw new ArgumentException("Category must be Hook");
            }

            CurrentHook = hook;
        }
コード例 #5
0
ファイル: FishingRod.cs プロジェクト: Stanis47/ConsoleFishing
        public void InstallLine(GearItem line)
        {
            if (line.Category != ItemCategory.FishingLine)
            {
                throw new ArgumentException("Category must be FishingLine");
            }

            CurrentLine = line;
        }
コード例 #6
0
ファイル: FishingRod.cs プロジェクト: Stanis47/ConsoleFishing
        public void InstallReel(GearItem reel)
        {
            if (reel.Category != ItemCategory.Reel)
            {
                throw new ArgumentException("Category must be Reel");
            }

            CurrentReel = reel;
        }