external lib
This commit is contained in:
23
PeopleVille.Extension.Mod1/Class1.cs
Normal file
23
PeopleVille.Extension.Mod1/Class1.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using PeopleVille.Equipment;
|
||||
using PeopleVille.Persons;
|
||||
|
||||
namespace PeopleVille.Extension.Mod1;
|
||||
|
||||
public class Snake : IEquipment
|
||||
{
|
||||
|
||||
public void Equip()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Unequip()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Use(Person person)
|
||||
{
|
||||
Console.WriteLine($"{person.Name} brugte en slange, lol");
|
||||
}
|
||||
}
|
||||
13
PeopleVille.Extension.Mod1/PeopleVille.Extension.Mod1.csproj
Normal file
13
PeopleVille.Extension.Mod1/PeopleVille.Extension.Mod1.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../PeopleVille/PeopleVille.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -29,7 +29,7 @@ namespace PeopleVille.Persons
|
||||
// 50/50 om vi gør noget eller ej
|
||||
if (RNG.ThrowDice(Dices.D3) == 1)
|
||||
return;
|
||||
switch (RNG.ThrowDice(Dices.D3))
|
||||
switch (RNG.ThrowDice(Dices.D4))
|
||||
{
|
||||
case 1:
|
||||
bool hasGun = Inventory.OfType<Gun>().Any();
|
||||
@@ -61,6 +61,17 @@ namespace PeopleVille.Persons
|
||||
Console.WriteLine($"{Name} Gik hen til {CurrentLocation.Name}");
|
||||
break;
|
||||
case 3:
|
||||
try
|
||||
{
|
||||
var items = this.Inventory.Where(x => x is not Gun && x is not Food).ToList();
|
||||
|
||||
items[RNG.Range(0, items.Count)].Use(this);
|
||||
} catch
|
||||
{
|
||||
Console.WriteLine($"{this.Name} brugte ikke nogle items");
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//Do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ var world = new WorldBuilder()
|
||||
.AddGameManager()
|
||||
.AddEquipment()
|
||||
.FromRange([gun, kage])
|
||||
.FromFolder("/home/smallbenji/school/hf2/HF2-peopleville/PeopleVille.Extension.Mod1/bin/Debug/net10.0")
|
||||
.AddLocations()
|
||||
.FromRange(locationBuilder.CreateLocations(15))
|
||||
.AddPersons()
|
||||
|
||||
@@ -39,21 +39,4 @@ namespace PeopleVille.WorldBuilder
|
||||
IPersonBuilder WithRandomItems(int number);
|
||||
IWorldBuilder EndWorldBuilding();
|
||||
}
|
||||
|
||||
// public interface ITownBuilder
|
||||
// {
|
||||
// ITownBuilder AddGunStore(string name);
|
||||
// ITownBuilder AddEggStore(string name);
|
||||
// ITownBuilder AddBank(string name);
|
||||
// List<Location> BuildTown();
|
||||
// }
|
||||
|
||||
// public interface ICitizenBuilder
|
||||
// {
|
||||
// ICitizenBuilder CreateAdult(string name, int health);
|
||||
// ICitizenBuilder CreateChild(string name, int health);
|
||||
// ICitizenBuilder WithGun(string name, int damage);
|
||||
// ICitizenBuilder WithFood(string name, int healthPoints);
|
||||
// List<Person> BuildCitizens();
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<Solution>
|
||||
<Project Path="PeopleVille.Extension.Mod1/PeopleVille.Extension.Mod1.csproj" />
|
||||
<Project Path="PeopleVille/PeopleVille.csproj" />
|
||||
</Solution>
|
||||
|
||||
Reference in New Issue
Block a user