Add game example to template pattern
This commit is contained in:
24
src/TemplatePattern/GameExample/Game.cs
Normal file
24
src/TemplatePattern/GameExample/Game.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TemplatePattern.GameExample
|
||||
{
|
||||
public abstract class Game
|
||||
{
|
||||
protected abstract void InitGame();
|
||||
|
||||
protected abstract void StartGame();
|
||||
|
||||
protected abstract void EndGame();
|
||||
|
||||
public void Play()
|
||||
{
|
||||
InitGame();
|
||||
StartGame();
|
||||
EndGame();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user