Last active
November 14, 2016 19:05
-
-
Save dskjal/fe427c256e81792f2cd4865c1a5b16d7 to your computer and use it in GitHub Desktop.
Effect Stack クラス
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
class PlayerData{ | |
public int HP; | |
// そのほかのパラメータ | |
} | |
enum EffectStatus{ | |
TimeOut | |
} | |
interface IEffect{ | |
EffectStatus AddEffect(PlayerData data); | |
} | |
class EffectStack{ | |
List<IEffect> effects; | |
// 引数としてプレイヤーの補正前のステータスのコピーを受け取る | |
public PlayerData CorrectStatus(PlayerData rawStatus){ | |
foreach(var e in effects){ | |
if(e.AddEffect(rawStatus) == EffectStatus.TimeOut){ | |
// エフェクトを削除 | |
} | |
} | |
return rawStatus; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment