1 Star 0 Fork 2

411592004/DesignPatternInC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FootballTempl.c 428 Bytes
一键复制 编辑 原始数据 按行查看 历史
TaoXing 提交于 2019-04-22 13:37 +08:00 . 增加模板方法模式
#include <stdio.h>
#include "ExtendTemplate.h"
static void Initialize(Game *pGame)
{
puts("Football Game Initialized! Start playing.");
}
static void Start(Game *pGame)
{
puts("Football Game Started. Enjoy the game!");
}
static void End(Game *pGame)
{
puts("Football Game Finished!");
}
Game * WithFootballTempl(Game * pGame)
{
pGame->Initialize = Initialize;
pGame->Start = Start;
pGame->End = End;
return pGame;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/bailingniao_760/DesignPatternInC.git
git@gitee.com:bailingniao_760/DesignPatternInC.git
bailingniao_760
DesignPatternInC
DesignPatternInC
master

搜索帮助