Ejemplo n.º 1
0
        public override bool IsPossible()
        {
            var result = NormalPlayerStrategyInfo.Board.Players.Count > 2 &&
                         NormalPlayerStrategyInfo.ShouldInitiateKnowledgeExchange();

            return(result);
        }
 public PickupPieceStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsAbleToTestStrategyTransition(playerStrategyInfo)
     };
 }
Ejemplo n.º 3
0
 public DestroyPieceStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new HasNoPieceStrategyTransition(playerStrategyInfo)
     };
 }
 public DiscoverStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new MoveToPieceStrategyTransition(playerStrategyInfo)
     };
 }
 public ReportGoalFieldsStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsThereSomeoneToCommunicateWithStrategyTransition(playerStrategyInfo),
         new IsInGoalWithoutPieceStrategyTransition(playerStrategyInfo)
     };
 }
Ejemplo n.º 6
0
 public InitStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Immediate,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsInGoalWithoutPieceStrategyTransition(playerStrategyInfo),
         new IsInTaskAreaStrategyTransition(playerStrategyInfo)
     };
 }
Ejemplo n.º 7
0
 public MoveToUndiscoveredGoalStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsNormalPlayerBlockedTransition(playerStrategyInfo, this),
         new IsOnDesiredUndiscoveredGoalFieldStrategyTransition(playerStrategyInfo),
         new HasNormalPieceStrategyTransition(playerStrategyInfo)
     };
 }
 public InitialMoveAfterPlaceStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Immediate,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsNormalPlayerBlockedTransition(playerStrategyInfo,
                                             new InGoalAreaMovingToTaskStrategyState(playerStrategyInfo)),
         new IsInGoalWithoutPieceStrategyTransition(playerStrategyInfo)
     };
 }
 public InGoalAreaMovingToTaskStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     Transitions = new Transition[]
     {
         new IsNormalPlayerBlockedTransition(playerStrategyInfo, this),
         new IsInGoalWithoutPieceStrategyTransition(playerStrategyInfo),
         new IsInTaskAreaStrategyTransition(playerStrategyInfo)
     };
 }
 public MoveToPieceStrategyState(NormalPlayerStrategyInfo playerStrategyInfo) : base(
         StateTransitionType.Triggered,
         playerStrategyInfo)
 {
     RestrictedToTaskArea = true;
     Transitions          = new Transition[]
     {
         new IsNormalPlayerBlockedTransition(playerStrategyInfo, this),
         new IsOnFieldWithNoPieceStrategyTransition(playerStrategyInfo),
         new IsNoPieceAvailableStrategyTransition(playerStrategyInfo),
         new IsOnFieldWithPieceStrategyTransition(playerStrategyInfo)
     };
 }
Ejemplo n.º 11
0
        public NormalPlayerStrategy(PlayerBase player, BoardBase board, Guid playerGuid, int gameId)
        {
            var teamCoefficient        = player.Team == TeamColor.Blue ? 0 : 1;
            var offset                 = teamCoefficient * (board.TaskAreaSize + board.GoalAreaSize);
            var undiscoveredGoalFields = new List <GoalField>();

            for (var i = 0; i < board.Width; ++i)
            {
                for (var j = offset; j < offset + board.GoalAreaSize; ++j)
                {
                    undiscoveredGoalFields.Add(board[new Location(i, j)] as GoalField);
                }
            }

            undiscoveredGoalFields.Shuffle();

            NormalPlayerStrategyInfo = new NormalPlayerStrategyInfo(board, player.Id, playerGuid, gameId, player.Team,
                                                                    undiscoveredGoalFields);
        }
Ejemplo n.º 12
0
 public IsOnFieldWithNoPieceStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }
Ejemplo n.º 13
0
 public HasShamStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }
 public MoveToPieceStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }
 public IsInTaskAreaStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }
 public IsNoPieceAvailableStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
     _directionGenerator = new Random();
 }
 public IsOnDesiredUndiscoveredGoalFieldStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) :
     base(
         normalPlayerStrategyInfo)
 {
 }
Ejemplo n.º 18
0
 public IsThereSomeoneToCommunicateWithStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) :
     base(
         normalPlayerStrategyInfo)
 {
 }
Ejemplo n.º 19
0
 protected NormalPlayerStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
     NormalPlayerStrategyInfo = normalPlayerStrategyInfo;
 }
 public IsNormalPlayerBlockedTransition(NormalPlayerStrategyInfo gamePlayStrategyInfo,
                                        NormalPlayerStrategyState fromState) : base(gamePlayStrategyInfo, fromState)
 {
     _normalPlayerStrategyInfo = gamePlayStrategyInfo;
 }
Ejemplo n.º 21
0
 public IsAbleToTestStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }
Ejemplo n.º 22
0
 public IsInGoalWithoutPieceStrategyTransition(NormalPlayerStrategyInfo normalPlayerStrategyInfo) : base(
         normalPlayerStrategyInfo)
 {
 }