This commit is contained in:
parent
6bb6258da3
commit
1416c7149b
3 changed files with 87 additions and 0 deletions
33
Mud Designer/MudEngine/GameObjects/Bag.cs
Normal file
33
Mud Designer/MudEngine/GameObjects/Bag.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MudDesigner.MudEngine.GameObjects.Items;
|
||||
|
||||
namespace MudDesigner.MudEngine.GameObjects
|
||||
{
|
||||
public class Bag : BaseObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the size of the bag.
|
||||
/// </summary>
|
||||
public int Size
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
private List<Items.BaseItem> Items { get; set; }
|
||||
|
||||
public void Add(BaseItem item)
|
||||
{
|
||||
if (Items.Count < Size)
|
||||
Items.Add(item);
|
||||
}
|
||||
|
||||
public int GetSlotsRemaining()
|
||||
{
|
||||
return Size - Items.Count;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue