mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
Remove " " space from the names
This commit is contained in:
parent
bef3032886
commit
8e451633dc
59 changed files with 391 additions and 391 deletions
39
Horse Isle Server/HorseIsleServer/Game/Services/Vet.cs
Normal file
39
Horse Isle Server/HorseIsleServer/Game/Services/Vet.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
class Vet
|
||||
{
|
||||
|
||||
public static List<Vet> Vets = new List<Vet>();
|
||||
|
||||
public Vet(int id, double price)
|
||||
{
|
||||
Id = id;
|
||||
PriceMultiplier = price;
|
||||
Vets.Add(this);
|
||||
}
|
||||
|
||||
public int Id;
|
||||
public double PriceMultiplier;
|
||||
public int CalculatePrice(int health)
|
||||
{
|
||||
double price = (1000.0 - (double)health) * PriceMultiplier;
|
||||
return Convert.ToInt32(Math.Round(price));
|
||||
}
|
||||
|
||||
public static Vet GetVetById(int id)
|
||||
{
|
||||
foreach(Vet vet in Vets)
|
||||
{
|
||||
if (id == vet.Id)
|
||||
return vet;
|
||||
}
|
||||
throw new KeyNotFoundException("Vet with id: " + id + " Not found.");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue