• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Situation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Situation的典型用法代码示例。如果您正苦于以下问题:C# Situation类的具体用法?C# Situation怎么用?C# Situation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Situation类属于命名空间,在下文中一共展示了Situation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: DoubleSelfTackleAddsTwoBeers

        public void DoubleSelfTackleAddsTwoBeers()
        {
            var pos = getStartPositions();
            pos[0] = Position.Green5;
            pos[1] = Position.Green5;
            pos[4] = Position.RedStart;

            var sit = new Situation(pos);
            var moves = sit.GetMoves(Piece.Green, 2);
            sit.ApplyMove(moves[0]);

            Assert.AreEqual(2, sit.beers[(int)Piece.Green]);
        }
开发者ID:omahlama,项目名称:Limake,代码行数:13,代码来源:SituationTest.cs


示例17: Estimate

        public TaxEstimate Estimate(Situation situation)
        {
            var estimate = new TaxEstimate(situation);
            var bracket = _bracketSelector.SelectBracket(situation);
            estimate.TaxOnIncome = bracket.CalculateTaxPayable(situation);

            foreach (var modifier in _modifiers)
            {
                modifier.Apply(estimate);
            }

            return estimate;
        }
开发者ID:p69,项目名称:magellan-framework,代码行数:13,代码来源:TaxEstimator.cs


示例18: GetKey

        private int GetKey(Situation s, Piece side)
        {
            int start = ((int)side - 1) * 4;

            byte[] arr = new byte[4];
            for (int i = 0; i < 4; i++)
            {
                arr[i] = (byte)GetGreenEquivalent(s.pieces[start + i], side);
            }

            Array.Sort<byte>(arr);

            return (arr[0] << 24) + (arr[1] << 16) + (arr[2] << 8) + arr[3];
        }
开发者ID:omahlama,项目名称:Limake,代码行数:14,代码来源:SinglePlayerData.cs


示例19: GetValidAreaScope

        public virtual IEnumerable<Point2> GetValidAreaScope(Situation situation, WarUnit doer, Point2 center, out IEnumerable<Point2> areaScope)
        {
            var validAreaPoints = new List<Point2>();
            areaScope = GetAreaScope(situation, doer, center);

            foreach (var p in areaScope)
            {
                if (IsValidPoint(situation, doer, p))
                {
                    validAreaPoints.Add(p);
                }
            }
            return validAreaPoints;
        }
开发者ID:ProjectTane,项目名称:FarenDotNet,代码行数:14,代码来源:AbstractScope.cs


示例20: EatIfYouCan

        public void EatIfYouCan()
        {
            var pos = getStartPositions();
            pos[0] = Position.Blue1;
            pos[1] = Position.Green1;
            pos[4] = Position.Green3;

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Size类代码示例发布时间:2022-05-24
下一篇:
C# Sites类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap