Changed whole project structure (split client and server into separat projects)

This commit is contained in:
hydrant
2019-02-25 22:12:05 +01:00
parent d2181c4987
commit 33abb3d04f
185 changed files with 282 additions and 596 deletions

View File

@@ -0,0 +1,24 @@
using reallife_gamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Items Cheeseburger (Cheeseburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Items
{
public class Cheeseburger : FoodItem
{
public override int Id => 2;
public override string Name => "Cheeseburger";
public override string Description => "Wie der Hamburger, nur mit Käse.";
public override int Gewicht => 320;
public override string Einheit => "g";
public override int HpAmount => 20;
public override uint Object => 2240524752;
}
}

View File

@@ -0,0 +1,24 @@
using reallife_gamemode.Server.Inventory.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
/**
* @overview Life of German Reallife - Inventory Items Chickenburger (Chickenburger.cs)
* @author VegaZ
* @copyright (c) 2008 - 2018 Life of German
*/
namespace reallife_gamemode.Server.Inventory.Items
{
public class Chickenburger : FoodItem
{
public override int Id => 3;
public override string Name => "Chickenburger";
public override string Description => "Hühnchenburger";
public override int Gewicht => 330;
public override string Einheit => "g";
public override int HpAmount => 25;
public override uint Object => 2240524752;
}
}

View File

@@ -0,0 +1,28 @@
using GTANetworkAPI;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Extensions;
using reallife_gamemode.Server.Inventory.Interfaces;
using reallife_gamemode.Server.Managers;
using System;
using System.Collections.Generic;
using System.Text;
namespace reallife_gamemode.Server.Inventory.Items
{
public abstract class DropItem : IDroppableItem
{
public abstract int HpAmount { get; }
public abstract int Id { get; }
public abstract string Name { get; }
public abstract string Description { get; }
public abstract int Gewicht { get; }
public abstract string Einheit { get; }
public abstract uint Object { get; }
public void Drop(UserItem uItem, Client player, int amount)
{
player.SendNotification("Du hast ~g~" + amount + " ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~weggeworfen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, amount);
}
}
}

View File

@@ -0,0 +1,37 @@
using GTANetworkAPI;
using reallife_gamemode.Server.Entities;
using reallife_gamemode.Server.Extensions;
using reallife_gamemode.Server.Inventory.Interfaces;
using reallife_gamemode.Server.Managers;
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 abstract int Id { get; }
public abstract string Name { get; }
public abstract string Description { get; }
public abstract int Gewicht { get; }
public abstract string Einheit { get; }
public abstract uint Object { get; }
public void Use(UserItem uItem)
{
Client player = uItem.GetUser().GetClient();
int amountToAdd = HpAmount;
if(player.Health + amountToAdd > 100)
{
amountToAdd = 100 - player.Health;
}
player.Health += amountToAdd;
player.SendNotification("Du hast ein/einen ~y~" + InventoryManager.GetItemById(uItem.ItemId).Name + " ~s~gegessen.", false);
InventoryManager.RemoveUserItem(player.GetUser(), uItem, 1);
}
}
}

View File

@@ -0,0 +1,24 @@
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
{
public override int Id => 1;
public override string Name => "Hamburger";
public override string Description => "Ein leckerer Hamburger.";
public override int Gewicht => 300;
public override string Einheit => "g";
public override int HpAmount => 20;
public override uint Object => 2240524752;
}
}

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 Holz : IDroppableItem
{
public int Id => 4;
public string Name => "Holz";
public string Description => "Ich und mein Holz.";
public int Gewicht => 1000;
public string Einheit => "g";
public uint Object => 1805779401;
}
}

View File

@@ -0,0 +1,24 @@
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 Kraftstoff : DropItem
{
public override int Id => 5;
public override string Name => "Kraftstoff";
public override string Description => "Der Stoff gibt dir Kraft.";
public override int Gewicht => 1000;
public override string Einheit => "g";
public override int HpAmount => 20;
public override uint Object => 786272259;
}
}