Re-fabrication
This commit is contained in:
parent
f155a47073
commit
cb6309abdb
499 changed files with 7574 additions and 12530 deletions
40
Yavsc.Server/Models/Market/Money.cs
Normal file
40
Yavsc.Server/Models/Market/Money.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
|
||||
namespace Yavsc.Models.Market {
|
||||
/// <summary>
|
||||
/// Not yet used!
|
||||
/// </summary>
|
||||
public class Money : IUnit<decimal>
|
||||
{
|
||||
public Money(string name, decimal euroExchangeRate)
|
||||
{
|
||||
Name = name;
|
||||
EuroExchangeRate = euroExchangeRate;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get; private set ;
|
||||
}
|
||||
|
||||
public decimal EuroExchangeRate
|
||||
{
|
||||
get; private set ;
|
||||
}
|
||||
public bool CanConvertFrom(IUnit<decimal> other)
|
||||
{
|
||||
if (other is Money)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public decimal ConvertFrom(IUnit<decimal> other, decimal orgValue)
|
||||
{
|
||||
if (other is Money) {
|
||||
var om = other as Money;
|
||||
return orgValue * om.EuroExchangeRate / EuroExchangeRate;
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue