Compare commits
3 Commits
eb1b7ee688
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 650379e8f9 | |||
|
|
94bd4d1f05 | ||
| 0a3c20d687 |
@@ -5,7 +5,7 @@ namespace PeopleVille.Extension.Mod1;
|
|||||||
|
|
||||||
public class Snake : IEquipment
|
public class Snake : IEquipment
|
||||||
{
|
{
|
||||||
|
public string Name { get; set; } = "Snake";
|
||||||
public void Equip()
|
public void Equip()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
@@ -21,3 +21,23 @@ public class Snake : IEquipment
|
|||||||
Console.WriteLine($"{person.Name} brugte en slange, lol");
|
Console.WriteLine($"{person.Name} brugte en slange, lol");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Trumpet : IEquipment
|
||||||
|
{
|
||||||
|
public string Name { get; set; } = "Trumpet med 90 grader";
|
||||||
|
|
||||||
|
public void Equip()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unequip()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Use(Person person)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{person.Name} brugte en trumpet, musik lyder i {person.CurrentLocation.Name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,8 +19,14 @@ namespace PeopleVille.Equipment
|
|||||||
|
|
||||||
public void Use(Person target)
|
public void Use(Person target)
|
||||||
{
|
{
|
||||||
target.Health -= this.Damage;
|
try
|
||||||
Console.WriteLine($"{target.Name} er blevet skudt og mistede {Damage} liv");
|
{
|
||||||
|
target.Health -= this.Damage;
|
||||||
|
Console.WriteLine($"{target.Name} er blevet skudt og mistede {Damage} liv");
|
||||||
|
} catch
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{target.Name} prøvede at skyde, men det virkede ikke, øv bøv");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PeopleVille.Locations;
|
|
||||||
|
|
||||||
namespace PeopleVille
|
namespace PeopleVille
|
||||||
{
|
{
|
||||||
public class GameManager
|
public class GameManager
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using PeopleVille.Equipment;
|
|
||||||
|
|
||||||
namespace PeopleVille.Locations
|
namespace PeopleVille.Locations
|
||||||
{
|
{
|
||||||
public class Store : Location
|
public class Store : Location
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ namespace PeopleVille.Persons
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 50/50 om vi gør noget eller ej
|
|
||||||
if (RNG.ThrowDice(Dices.D3) == 1)
|
if (RNG.ThrowDice(Dices.D3) == 1)
|
||||||
return;
|
return;
|
||||||
switch (RNG.ThrowDice(Dices.D4))
|
switch (RNG.ThrowDice(Dices.D4))
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using PeopleVille.Equipment;
|
using PeopleVille.Equipment;
|
||||||
using PeopleVille.Locations;
|
using PeopleVille.Locations;
|
||||||
using PeopleVille.Persons;
|
using PeopleVille.Persons;
|
||||||
using PeopleVille;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
namespace PeopleVille.WorldBuilder
|
namespace PeopleVille.WorldBuilder
|
||||||
{
|
{
|
||||||
@@ -110,9 +109,17 @@ namespace PeopleVille.WorldBuilder
|
|||||||
{
|
{
|
||||||
var instances = new List<T>();
|
var instances = new List<T>();
|
||||||
string[] dlls = Directory.GetFiles(pathToAssemblyFolder, "*.dll");
|
string[] dlls = Directory.GetFiles(pathToAssemblyFolder, "*.dll");
|
||||||
|
var baseAssemblyName = typeof(T).Assembly.GetName().Name;
|
||||||
|
|
||||||
foreach (var dll in dlls)
|
foreach (var dll in dlls)
|
||||||
{
|
{
|
||||||
|
var assemblyName = AssemblyName.GetAssemblyName(dll).Name;
|
||||||
|
|
||||||
|
if (string.Equals(assemblyName, baseAssemblyName, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
instances.AddRange(LoadTypesFromAssembly<T>(dll));
|
instances.AddRange(LoadTypesFromAssembly<T>(dll));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
### Benjamin
|
### Benjamin
|
||||||
- [x] Implementer dynamisk import af "eksterne" dll'er
|
- [x] Implementer dynamisk import af "eksterne" dll'er
|
||||||
- [x] Find ud af hvordan tid skal fungere
|
- [x] Find ud af hvordan tid skal fungere
|
||||||
- [ ] Lav ny data så program kan køre
|
- [x] Lav ny data så program kan køre
|
||||||
### Mikkel
|
### Mikkel
|
||||||
- [x] Opret logik DoSomething()
|
- [x] Opret logik DoSomething()
|
||||||
- [x] Personer skal kunne skifte lokation
|
- [x] Personer skal kunne skifte lokation
|
||||||
|
|||||||
Reference in New Issue
Block a user