本文整理汇总了C#中Situation类的典型用法代码示例。如果您正苦于以下问题:C# Situation类的具体用法?C# Situation怎么用?C# Situation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Situation类属于命名空间,在下文中一共展示了Situation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemovedConditonTable
public void RemovedConditonTable(Situation situation, WarUnit unit)
{
// 追加したデリゲートは全て削除する
unit.ReviseStatus -= ReviseStatus;
unit.DamageEvent -= WakeUpCheck;
Phases.TurnPhase.Start -= AutoRecoveryCheck;
}
示例2: WarPresentationModel
public WarPresentationModel(Situation situation)
{
CancelCommandStack = new Stack<Func<bool>>();
Situation = situation;
_chipAnimations = new AnimationManager<AnimationSprite>();
_screenAnimations = new AnimationManager<AnimationSurface>();
}
示例3: GetKey
private static int GetKey(Situation s)
{
byte[] arr = new byte[] { (byte)s.pieces[0], (byte)s.pieces[1], (byte)s.pieces[2], (byte)s.pieces[3] };
Array.Sort<byte>(arr);
return (arr[0] << 24) + (arr[1] << 16) + (arr[2] << 8) + arr[3];
}
示例4: AutoRecoveryCheck
private void AutoRecoveryCheck(Situation situation)
{
if (WarGlobal.Random.NextUnfairBool(1.0 / 3))
{
_unit.Conditions.Remove(((IAbnormalCondition)this).ID, situation);
}
}
示例5: SelectMove
public int SelectMove(Situation situation, Move[] moves, Piece side, int roll)
{
Move[] c = new Move[moves.Length];
Array.Copy(moves, c, moves.Length);
Array.Sort<Move>(c, CompareMoves);
return Array.IndexOf<Move>(moves, c[0]);
}
示例6: PrintableScope
public PrintableScope(IScope scope, IList<Point2> rangePoints, IList<Point2> validRangePoints, Situation situation, WarUnit doer)
{
this.scope = scope;
this.situation = situation;
this.doer = doer;
this.RangeChips = rangePoints;
this.ValidRangeChips = validRangePoints;
}
示例7: WakeUpCheck
private void WakeUpCheck(Situation situation, WarUnit unit, WarUnit doer, int value)
{
// 攻撃者がいた場合のみ、復帰処理を行う
if (doer != null && WarGlobal.Random.NextUnfairBool(1.0 / 3))
{
unit.Conditions.Remove(((IAbnormalCondition)this).ID, situation);
}
}
示例8: AddedConditonTable
public void AddedConditonTable(Situation situation, WarUnit unit)
{
_unit = unit;
// 麻痺時のコマンドテーブル変化を適用する
unit.ReviseCommands += CommandEnableTableRevise;
// ターン開始時に状態異常が自動回復するかの判定処理を追加する
Phases.TurnPhase.Start += AutoRecoveryCheck;
}
示例9: GetAreaScope
public override IEnumerable<Point2> GetAreaScope(Situation situation, WarUnit doer, Point2 center)
{
var v = ScopeUtil.GetDirectionalVector(center - doer.Location);
var p = doer.Location;
for (int i = 0; i < _range; i++)
{
p += v;
yield return p;
}
}
示例10: ChangePhase
public IPhase ChangePhase(Situation situation, IPhase phase)
{
var oldPhase = _phaseStack.Pop();
oldPhase.Exit(situation);
_phaseStack.Push(phase);
phase.Start(situation);
return oldPhase;
}
示例11: AddedConditonTable
public void AddedConditonTable(Situation situation, WarUnit unit)
{
_unit = unit;
// 睡眠中は行動不可能
unit.ReviseStatus += ReviseStatus;
// 攻撃を受けたときの復帰処理を追加する
unit.DamageEvent += WakeUpCheck;
// ターン開始時に状態異常が自動回復するかの判定処理を追加する
Phases.TurnPhase.Start += AutoRecoveryCheck;
}
示例12: Game
public Game(IGameDisplay display, IPlayer[] players)
{
rand = new Random();
if (players == null || players.Length != 4)
{
throw new Exception("Need 4 players to play");
}
this.display = display;
this.players = players;
this.history = new List<HistoryEntry>();
situation = Situation.GameStart();
}
示例13: MoveToGoalIfPossible
public void MoveToGoalIfPossible()
{
var pos = getStartPositions();
pos[0] = Position.Yellow6;
pos[1] = Position.Green1;
var sit = new Situation(pos);
var moves = sit.GetMoves(Piece.Green, 2);
int selected = p.SelectMove(sit, moves, Piece.Green, 2);
var selectedMove = moves[selected];
Assert.AreEqual(Position.Yellow6, selectedMove.StartPosition);
}
示例14: GetOutOfHomeIfPossible
public void GetOutOfHomeIfPossible()
{
var pos = getStartPositions();
pos[0] = Position.Blue2;
var sit = new Situation(pos);
var moves = sit.GetMoves(Piece.Green, 6);
int selected = p.SelectMove(sit, moves, Piece.Green, 6);
var selectedMove = moves[selected];
Assert.AreEqual(Position.GreenStart, selectedMove.EndPosition);
}
示例15: AddingConditonTable
public bool AddingConditonTable(Situation situation, WarUnit unit, IAbnormalCondition oldCond)
{
Contract.Requires(oldCond.GetType() == GetType());
var cond = (AttackCountChangeCondition)oldCond;
var newCount = cond._changeAttackCount + _changeAttackCount;
// 変化量が0ならば削除、そうでなければ値を更新
if (newCount == 0)
unit.Conditions.Remove(ID, situation);
else
cond._changeAttackCount = _changeAttackCount;
return false;
}