static void Main(string[] args) { ConcreteDispatcherFactory factory = new ConcreteDispatcherFactory(); var red = new RedCell(); var blue = new BlueCell(); var disp = factory.CreateDispatcher(); var result = red.AcceptVisitor(disp.Visit(blue)); Console.WriteLine(result); Console.Write("Done"); Console.Read(); }
public TResult Visit(RedCell cell) { return(_takeRed(_target, cell)); }
public ICellVisitor <TResult> Visit(RedCell cell) { return(_redBuilder.Take(cell)); }
public string Visit(RedCell cell) { return(cell.Color); }
private string Do(RedCell a, RedCell b) { return("красное на красном"); }