Created
October 17, 2021 02:59
-
-
Save cch12313/97f36fa3d310d21bbda06cc6b177d8e0 to your computer and use it in GitHub Desktop.
Strategy Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace design_pattern | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Toyote car1 = new Toyote(); | |
Bens car2 = new Bens(); | |
Tezla car3 = new Tezla(); | |
car1.Skill(); | |
car2.Skill(); | |
car3.Skill(); | |
} | |
} | |
public class Toyote | |
{ | |
public void Skill() | |
{ | |
Console.WriteLine("推進器~"); | |
} | |
} | |
public class Bens | |
{ | |
public void Skill() | |
{ | |
Console.WriteLine("推進器~"); | |
} | |
} | |
public class Tezla | |
{ | |
public void Skill() | |
{ | |
Console.WriteLine("推進器~"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment