🩹 improve code
continuous-integration/drone/push Build is passing Details

pull/106/head
Ismail TAHA JANAN 3 years ago
parent 949521ff9b
commit e49afa3b14

@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Dice.Faces
{
public abstract class AbstractDieFace<T>
{
/// <summary>
/// every die face has a value, and they can all be represented by an int,
/// even if they're not litterally a decimal number
/// <br/>
/// USE GetPracticalValue for a Value specific to face type
/// </summary>
public T Value { get; protected set; }
public abstract T GetPracticalValue();
public AbstractDieFace(T value)
{
Value = value;
}
public override string ToString()
{
return GetPracticalValue().ToString();
}
}
}

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Dice.Faces
{
public class ColorDieFace : AbstractDieFace<Color>
{
/// <summary>
/// </summary>
/// <param name="hexValueString">Color type</param>
public ColorDieFace(Color hexValueString):base(hexValueString)
{}
public override Color GetPracticalValue()
{
// https://stackoverflow.com/questions/1139957/convert-integer-to-hexadecimal-and-back-again
return Value;
}
}
}

@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Dice.Faces
{
public class ImageDieFace : AbstractDieFace<Uri>
{
public ImageDieFace(Uri uri):base(uri)
{}
public override Uri GetPracticalValue()
{
return Value;
}
}
}

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Dice.Faces
{
public class NumberDieFace : AbstractDieFace<int>
{
public NumberDieFace(int value):base(value)
{}
public override int GetPracticalValue()
{
return Value;
}
}
}

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Dice.Faces;
namespace Model.Dice
{
public class HomogeneousDice<T>: Die
{
public HomogeneousDice(params Face[] faces) : base(faces)
{
}
}
}
Loading…
Cancel
Save