public Pawn(Position position, PawnColor pawnColor, PawnType pawnType, IMoveStrategy moveStrategy) { Position = position; PawnColor = pawnColor; PawnType = pawnType; MoveStrategy = moveStrategy; }
public IList <BotViewer> GetBots(Transform parent) { IList <BotViewer> bots = new List <BotViewer>(); IEnumerator <IBotSettings> enumerator = resourcesManager.GamePrefabs .GetBotsSettings() .GetEnumerator(); int i = 1; while (enumerator.MoveNext()) { IBotSettings botSettings = enumerator.Current; Transform botObj = Object.Instantiate(botSettings?.Transform(), parent); Vector2 startPosition = GetStartPosition(i); IMoveStrategy moveStrategy = _pullMoveStrategy.GetMoveStrategy(botSettings.Strategy()); IState state = new Move(botSettings.Trap(), botSettings.HitBoxRadius()); BotViewer botViewerView = new BotViewer(botObj, startPosition, state, moveStrategy); bots.Add(botViewerView); i++; } enumerator.Dispose(); return(bots); }
public Boletus(Texture2D spritesheet, Dictionary <string, Rectangle> map, IMoveStrategy strategy) : base(spritesheet, map, strategy) { AddAnimation("Attack", new SpriteSheetAnimationData(new int[] { 1, 2 }, frameDuration: 0.3f)); AddAnimation("Idle", new SpriteSheetAnimationData(new int[] { 0 })); AddAnimation("Walk", new SpriteSheetAnimationData(new int[] { 1, 2 }, frameDuration: 0.3f)); PlayAnimation("Idle"); }
public void SetMovementStrategy(IMoveStrategy moveStrategy) { if (moveable) { moveable.MoveStrategy = moveStrategy; } }
public StrategyResult CalculateResult(IMoveStrategy opponentsStrategy) { if (opponentsStrategy is RockStrategy) return StrategyResult.Won; if (opponentsStrategy is ScissorsStrategy) return StrategyResult.Lost; return StrategyResult.Drawn; }
public Moveable(double velocity, double maxVelocity, double rPM, double maxRPM, IShape shape, IMoveStrategy mover) { Velocity = velocity; MaxVelocity = maxVelocity; RPM = rPM; MaxRPM = maxRPM; Shape = shape; Mover = mover; }
public void ToggleHint() { _isHintActivated = !_isHintActivated; if (_isHintActivated) { _moveStrategy = _moveStrategy ?? new PierreDellacherieOnePiece(); DrawHint(); } }
public void Move() { IMoveStrategy strategy = MoveStrategies.Where(x => x.Direction == CurrentPosition.Direction).FirstOrDefault(); if (strategy != null) { strategy.Execute(this); } }
private void UpdateStrategy() { if (_health < 20) _strategy = _factory.GetMoveStrategy(MoveStrategy.Crawl); else if (_health < 40) _strategy = _factory.GetMoveStrategy(MoveStrategy.Walk); else _strategy = _factory.GetMoveStrategy(MoveStrategy.Run); }
public FrisbeeRenderer(Configs configs, FrisbeeFactory factory, Models models, IMoveStrategy move, ResourceMgr resources) { this.GameObj = GameObject.Instantiate( resources.frisbeePrefab, configs.DefaultFrisbeePos, Quaternion.Euler(0, 0, 0) ); this.localController = this.GameObj.AddComponent <FrisbeeController>(); this.localController.Inject(this, factory, models); this.Move = move; }
public BotViewer(Transform botObj , Vector2 startPosition , IState state , IMoveStrategy moveStrategy) { _transform = botObj; _startPosition = startPosition; _moveStrategy = moveStrategy; _state = state; }
public GameBot( Guid gameId, Guid playerId, GameHttpClient gameClient, IMoveStrategy moveStrategy ) { this.gameId = gameId; this.playerId = playerId; this.gameClient = gameClient; this.moveStrategy = moveStrategy; }
private void ResetGame() { _moveStrategy = new BruteForceHeuristicsStrategy(9); this.panelBoard.Controls.Clear(); CreateTicTacToeBoard(); _game = new TicTacToeGame(); if (chkComputerGoFirst.Checked) { DoComputerMove(-1); } }
public void Shoot(IMoveStrategy moveStrategy, Vector2 spawnPosition) { if (canShoot) { Projectile newGameObject = GameObject.Instantiate(projectilePrefab, spawnPosition, Quaternion.identity) as Projectile; moveStrategy.ControlledTransform = newGameObject.transform; newGameObject.SetMovementStrategy(moveStrategy); reloadTimer = 0; canShoot = false; } }
public override void onPickUp(Character c, float duration) { base.onPickUp(c, duration); if (defaultStrategy == null) { defaultStrategy = c.moveStrategy; } c.moveStrategy = new SlowMoveHalf(); if (c is Player p) { p.addItem = this; } }
public FuzzyLocationFeed(GeoCoordinate currentLocation, IMoveStrategy moveStrategy, int movementThreshold) { _observable = moveStrategy.Scan( Tuple.Create(currentLocation, currentLocation), (acc, cur) => { double distance = acc.Item1.GetDistanceTo(cur); if (distance >= movementThreshold) { return(Tuple.Create(cur, cur)); } return(Tuple.Create(acc.Item1, cur)); }).Where(pair => pair.Item1 == pair.Item2).Select(pair => pair.Item1); }
public PriestRenderer(int id, Vector3 pos, Materials mats, IMoveStrategy moveStrategy, MainSceneController globalController, Configs configs) { this.gameObj = GameObject.CreatePrimitive(PrimitiveType.Sphere); MeshRenderer meshRenderer = this.gameObj.GetComponent <MeshRenderer>(); meshRenderer.material = mats.Priest; Transform transform = this.gameObj.GetComponent <Transform>(); transform.position = pos; transform.localScale = configs.CharScale; PriestController localController = this.gameObj.AddComponent <PriestController>(); localController.Inject(id, this, globalController, configs); this.moveStrategy = moveStrategy; this.globalController = globalController; }
public BoatRenderer(Vector3 pos, Materials mats, IMoveStrategy moveStrategy, MainSceneController globalController, Configs configs) { this.gameObj = GameObject.CreatePrimitive(PrimitiveType.Cube); MeshRenderer meshRenderer = this.gameObj.GetComponent <MeshRenderer>(); meshRenderer.material = mats.Boat; Transform transform = this.gameObj.GetComponent <Transform>(); transform.position = pos; transform.localScale = configs.BoatScale; BoatController localController = this.gameObj.AddComponent <BoatController>(); localController.Inject(this, globalController); this.moveStrategy = moveStrategy; this.globalController = globalController; }
public GenericBot(IClient client, IMoveStrategy moveStrategy, ISpecialStrategy specialStrategy) { _client = client; SpecialStrategy = specialStrategy; MoveStrategy = moveStrategy; _client.RoundStarted += _client_OnRoundStarted; _client.GameStarted += client_OnGameStarted; _client.GameFinished += _client_OnGameFinished; _client.GameOver += _client_OnGameOver; _client.ContinuousEffectToggled += _client_OnContinuousEffectToggled; _stopEvent = new ManualResetEvent(false); _handleNextPieceEvent = new ManualResetEvent(false); SleepTime = 75; Activated = false; }
public JobService( IMoveStrategy moveStrategy , JobDbContext dbContext , IMapper mapper , ILogger <JobService> logger , IHttpContextAccessor httpContextAccessor , IServiceOrderService serviceOrderService , IHomeFrontEventService homeFrontEventService , IEventBus eventBus , IIntegrationEventLogService eventLogService) : base(dbContext, mapper, httpContextAccessor) { _moveStrategy = moveStrategy ?? throw new ArgumentNullException("moveStrategy"); _dbContext = dbContext ?? throw new ArgumentNullException("dbContext"); _mapper = mapper ?? throw new ArgumentNullException("mapper"); _logger = logger ?? throw new ArgumentNullException("logger"); _eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus)); _serviceOrderService = serviceOrderService ?? throw new ArgumentNullException("serviceOrderService"); _eventLogService = eventLogService ?? throw new ArgumentNullException("eventLogService"); _homeFrontEventService = homeFrontEventService ?? throw new ArgumentNullException("homeFrontEventService"); }
public override void Update(GameTime gameTime) { if (!Hidden) { healthTimer?.Update(gameTime); //Got hurt - go into rage mode (if we are not already in rage mode) if (currentHealth < maxHealth) { if (currentStrategy.GetType() != typeof(RageStrategy)) { currentStrategy = new RageStrategy(); } } if (attacking) { MoveableBodyState = MoveableBodyStates.Attacking; } //Debug.WriteLine(gameTime.TotalGameTime.ToString() + " " + MoveableBodyState); base.Update(gameTime); } }
public MainSceneController() { this.configs = new Configs(); this.materials = new Materials(configs); this.characters = new Characters(configs); new BankRenderer(this.configs.LeftBankPos, this.materials, this.configs); new BankRenderer(this.configs.RightBankPos, this.materials, this.configs); this.boatMove = new LinearMove2D(this.configs.BoatMoveSpeed); this.boat = new BoatRenderer(this.configs.RightBoatPos, this.materials, this.boatMove.Clone(), this, this.configs); this.priests = new PriestRenderer[this.configs.PeopleNum]; this.evils = new EvilRenderer[this.configs.PeopleNum]; this.charMove = new ParabolicMove2D(this.configs.CharMoveSummit, this.configs.CharMoveSpeed); for (int i = 0; i < this.configs.PeopleNum; i++) { this.priests[i] = new PriestRenderer(i, this.configs.RightCharPos[i + 2], materials, this.charMove.Clone(), this, this.configs); } for (int i = 0; i < this.configs.PeopleNum; i++) { this.evils[i] = new EvilRenderer(i, this.configs.RightCharPos[i + 2 + this.configs.PeopleNum], materials, this.charMove.Clone(), this, this.configs); } this.result = new ResultRenderer(this.configs.ResultPlanePos, this.configs.ResultPlaneRotation, this.configs.ResultPlaneScale, this.materials); }
public void setStrategy(IMoveStrategy algorithm) { this.algorithm = algorithm; }
public Motorbike() { _move = new DriveStrategy(); }
public Train() { _move = new DriveStrategy(); }
public Pegas(IMoveStrategy strategyMove) { this._strategyMove = strategyMove; }
public void SetStrategy(IMoveStrategy strategyMove) { this._strategyMove = strategyMove; }
// //public void Awake() //{ // var a = Camera.current.GetComponent<ChangeStrategyManager>(); // a.Subscribe(this); //} //public void OnCompleted() => throw new NotImplementedException(); //public void OnError(Exception error) => throw new NotImplementedException(); // //public void OnNext(IMoveStrategy value) //{ // SetStrategy(value); //} public void SetStrategy(IMoveStrategy moveStrategy) => _moveStrategy = moveStrategy;
public Troll(IMoveStrategy strategyMove) { this._strategyMove = strategyMove; }
public SequenceGenerator(Board board, IMoveStrategy moveStrategy, int pathSize) { _board = board; _moveStrategy = moveStrategy; _pathSize = pathSize; }
public PlayGameMoveHandler(IMoveStrategy moveStrategy, int sleepDuration) { _moveStrategy = moveStrategy; _sleepDuration = sleepDuration; }
public CompositeMove(IMoveStrategy strategy1, IMoveStrategy strategy2) { _moveStrategies = new[] { strategy1, strategy2 }; }
public Elf(IMoveStrategy strategyMove) { this._strategyMove = strategyMove; }
public Player(IMoveStrategy strategy, PlayerTypeEnum type) { this.Strategy = strategy; this.Type = type; }