// Constructor allows installing any propulsion method // that implements IPropulsion. This is "constructor injection." internal Robosnake(IPropulsion propulsionMethod) { // Now the snake will have the given propulsion method. _propel = propulsionMethod; }
// Constructor allows installing any propulsion method // that implements IPropulsion. This is "constructor injection." internal Robosnake(IPropulsion propulsionMethod) { // Now the snake will have the given propulsion method. _propel = propulsionMethod; }