Start work on Inventory System

This commit is contained in:
VegaZ
2018-10-25 21:54:53 +02:00
parent b0bafcfa00
commit 4b9225ed29
8 changed files with 153 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using GTANetworkAPI;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Interfaces DroppableItem (IDroppableItem.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Interfaces
{
public interface IDroppableItem
{
void Drop(Client player);
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Interfaces Item (IItem.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Interfaces
{
public interface IItem
{
int Id { get; }
string Name { get; }
string Description { get; }
int Gewicht { get; }
string Einheit { get; }
}
}

View File

@@ -0,0 +1,18 @@
using GTANetworkAPI;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Interfaces UsableItem (IUsableItem.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Interfaces
{
public interface IUsableItem
{
void Use(Client player);
}
}

View File

@@ -0,0 +1,18 @@
using GTANetworkAPI;
using reallife_gamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
namespace reallife_gamemode.Server.Inventory.Items
{
public abstract class FoodItem : IUsableItem
{
public abstract int HpAmount { get; }
public void Use(Client player)
{
player.Health += HpAmount;
}
}
}

View File

@@ -0,0 +1,23 @@
using reallife_gamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Items Hamburger (Hamburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Items
{
public class Hamburger : FoodItem, IItem
{
public int Id => 1;
public string Name => "Hamburger";
public string Description => "Ein leckerer Hamburger.";
public int Gewicht => 300;
public string Einheit => "g";
public override int HpAmount => 50;
}
}