protected override IMilitaryVehicle Create(string name) { Tank tank; var result = name.Replace(" ", "").ToLower(); if (result == "tiger") { tank = new Tiger(); } else if (result == "oi") { tank = new OI(); } else if (result == "renault") { tank = new Renault(); } else if (result == "stg") { tank = new STG(); } else if (result == "churchill") { tank = new Churchill(); } else { return(null); } //tank.Drive(); return(tank); //return new Tiger(); }
// public Tank CreateTank(string name) { Tank tank; var result = name.Replace(" ", "").ToLower(); if (result == "tiger") { tank = new Tiger(); } else if (result == "oi") { tank = new OI(); } else if (result == "renault") { tank = new Renault(); } else if (result == "stg") { tank = new STG(); } else if (result == "churchill") { tank = new Churchill(); } else { return(null); } return(tank); }
internal OI.Television InsTVDict(string tvTag, OI.Television tv) { if (!tvDict.ContainsKey(tvTag)) { tvDict.Add(tvTag, tv); greatCanvas.Children.Add(tv); return tv; } else return tvDict[tvTag]; }