当前位置: 首页>>代码示例>>C#>>正文


C# Situation类代码示例

本文整理汇总了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;
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:7,代码来源:SleepCondition.cs

示例2: WarPresentationModel

 public WarPresentationModel(Situation situation)
 {
     CancelCommandStack = new Stack<Func<bool>>();
     Situation = situation;
     _chipAnimations = new AnimationManager<AnimationSprite>();
     _screenAnimations = new AnimationManager<AnimationSurface>();
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:7,代码来源:WarPresentationModel.cs

示例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];
        }
开发者ID:omahlama,项目名称:Limake,代码行数:7,代码来源:SinglePlayerSolver.cs

示例4: AutoRecoveryCheck

 private void AutoRecoveryCheck(Situation situation)
 {
     if (WarGlobal.Random.NextUnfairBool(1.0 / 3))
     {
         _unit.Conditions.Remove(((IAbnormalCondition)this).ID, situation);
     }
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:7,代码来源:SleepCondition.cs

示例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]);
 }
开发者ID:omahlama,项目名称:Limake,代码行数:7,代码来源:BasicPlayer.cs

示例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;
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:8,代码来源:PrintableScope.cs

示例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);
     }
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:8,代码来源:SleepCondition.cs

示例8: AddedConditonTable

        public void AddedConditonTable(Situation situation, WarUnit unit)
        {
            _unit = unit;

            // 麻痺時のコマンドテーブル変化を適用する
            unit.ReviseCommands += CommandEnableTableRevise;

            // ターン開始時に状態異常が自動回復するかの判定処理を追加する
            Phases.TurnPhase.Start += AutoRecoveryCheck;
        }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:10,代码来源:ParalysisCondition.cs

示例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;
     }
 }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:10,代码来源:StraightScope.cs

示例10: ChangePhase

        public IPhase ChangePhase(Situation situation, IPhase phase)
        {
            var oldPhase = _phaseStack.Pop();
            oldPhase.Exit(situation);

            _phaseStack.Push(phase);
            phase.Start(situation);

            return oldPhase;
        }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:10,代码来源:PhaseManager.cs

示例11: AddedConditonTable

        public void AddedConditonTable(Situation situation, WarUnit unit)
        {
            _unit = unit;

            // 睡眠中は行動不可能
            unit.ReviseStatus += ReviseStatus;

            // 攻撃を受けたときの復帰処理を追加する
            unit.DamageEvent += WakeUpCheck;

            // ターン開始時に状態異常が自動回復するかの判定処理を追加する
            Phases.TurnPhase.Start += AutoRecoveryCheck;
        }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:13,代码来源:SleepCondition.cs

示例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();
        }
开发者ID:omahlama,项目名称:Limake,代码行数:13,代码来源:Game.cs

示例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);
        }
开发者ID:omahlama,项目名称:Limake,代码行数:13,代码来源:BasicPlayerTest.cs

示例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);
        }
开发者ID:omahlama,项目名称:Limake,代码行数:13,代码来源:BasicPlayerTest.cs

示例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;
        }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:13,代码来源:AttackCountChangeCondition.cs


注:本文中的Situation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。