Start work on Inventory System
This commit is contained in:
18
Server/Inventory/Interfaces/IDroppableItem.cs
Normal file
18
Server/Inventory/Interfaces/IDroppableItem.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
21
Server/Inventory/Interfaces/IItem.cs
Normal file
21
Server/Inventory/Interfaces/IItem.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
18
Server/Inventory/Interfaces/IUsableItem.cs
Normal file
18
Server/Inventory/Interfaces/IUsableItem.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
18
Server/Inventory/Items/FoodItem.cs
Normal file
18
Server/Inventory/Items/FoodItem.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
Server/Inventory/Items/Hamburger.cs
Normal file
23
Server/Inventory/Items/Hamburger.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user