using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace strategyTest
{
class Program
{
static void Main(string[] args)
{
Context con = new Context(new con2());
Console.Write( con.set(2));
Console.ReadKey();
}
}
interface con {
double caclu(int f);
}
class con1 : con
{
public double caclu(int f)
{
return f +1;
}
}
class con2 : con
{
public double caclu(int f)
{
return f + 2;
}
}
class con3 : con
{
public double caclu(int f)
{
return f + 3;
}
}
class Context {
con Con;
public Context(con Con)
{
this.Con = Con;
}
public double set(int f) {
return Con.caclu(f);
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace strategyTest
{
class Program
{
static void Main(string[] args)
{
Context con = new Context(new con2());
Console.Write( con.set(2));
Console.ReadKey();
}
}
interface con {
double caclu(int f);
}
class con1 : con
{
public double caclu(int f)
{
return f +1;
}
}
class con2 : con
{
public double caclu(int f)
{
return f + 2;
}
}
class con3 : con
{
public double caclu(int f)
{
return f + 3;
}
}
class Context {
con Con;
public Context(con Con)
{
this.Con = Con;
}
public double set(int f) {
return Con.caclu(f);
}
}
}