I'm new in programming, I have created an interface which name is IPointCalculator I have implemented it in this class:
public class PointCalculator : IPointCalculator
{
EnemisEntity enm = new EnemisEntity();
public int pointCal(string enemyType)
{
int point = 0;
if (enemyType == enm.banzai_Bill)
{
point = 200;
}
else if (enemyType == enm.beach_koopa)
{
point = 400;
}
else if (enemyType == enm.big_boo)
{
point = 800;
}
else if(enemyType==enm.blargg)
{
point = 1600;
}
return point;
}
}
now in my console application, I want to use it:
class Program
{
IPointCalculator _ipCal;
Program(IPointCalculator pntCal)
{
_ipCal = pntCal;
}
public static void Main(string[] args)
{
}
}
but I cant use _ipCal in my Main, how should I use it here? Is it the right way?