/// <summary> /// Initializes a new instance of the MoveableField class. /// </summary> /// <param name="field"> The field.</param> /// <param name="movement">(optional) The movement.</param> public MoveableField(IField field, IMovement movement = null) { Validation.ThrowIfNull(field); this._field = field; this._movement = movement ?? new BackwardMovement(field); }
public void Init() { this._field = new Field(); this._field.Position = new Position(2, 2); this._originalPosition = this._field.Position.Clone(); this._movement = new StraightMovement(this._field); }
void Awake() { _input = new Input(transform); _movement = new Movement(GetComponent<Rigidbody2D>()); _state = State.Idle; _animator = GetComponentInChildren<Animator>(); }
public Player(IMovement movement, IEntityFactory networkPlayer, ICurrentNode currentNode, string name) { currentNode.SetName(name); networkPlayer.CreateNetworkingPlayer(); _name = name; }
// Use this for initialization void Start() { rb2d = gameObject.GetComponent<Rigidbody2D> (); animator = gameObject.GetComponent<Animator> (); movement = getDefaultMovement (); dragon = GameObject.FindGameObjectWithTag ("Dragon").GetComponent<Dragon> (); textManager = GameObject.FindGameObjectWithTag ("TextManager").GetComponent<TextManager> (); }
protected override void Awake() { base.Awake(); Movement = gameObject.GetComponentInChildren<IMovement>() as IMovement; Interactor = gameObject.GetComponentInChildren<InteractorAI>() as InteractorAI; if(Movement == null) throw new UnityException(string.Format(Strings.ErrorMissingComponentOnObject, "IMovement", this.name)); if(Interactor == null) throw new UnityException(string.Format(Strings.ErrorMissingComponentOnObject, "InteractorAI", this.name)); }
public Movement() { _deadState = new DeadState(this); _fallingState = new FallingState(this); _gettingHitState = new GettingHitState(this); _jumpingState = new JumpingState(this); _motionlessState = new MotionlessState(this); _runningState = new RunningState(this); _walkingState = new WalkingState(this); _throwingState = new ThrowingState(this); _currentState = _motionlessState; }
/// <summary> Default constructor. </summary> /// public BolterInterface() { _basePath = AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new[] { '\\' }); _localCamera = new Camera(); _localMovement = new Movement(); _localGameCalls = new GameCalls(); _localInput = new Input(); _localResources = new Resources(Path.GetDirectoryName(_basePath) + "\\Resources\\Items.obj"); _localTarget = new Target(); _localZone = new Zone(); _localInventory = new Inventory(); Bolter.GlobalInterface = this; }
private FakeGameEngine() { this._ioProvider = new ConsoleIOProvider(); this._player = new Player(); this._field = new Field(); this._movement = new StraightMovement(this._field); var gameUISettngs = new DefaultUIEngineSettings<ConsoleIOProvider>(this._ioProvider, this._player); var gameUI = new UIEngine<ConsoleIOProvider>(gameUISettngs); this._gameEngineSettings = new GameEngineSettings<IDefaultUIEngine, IIntegerStats>(gameUI, this._field, this._player, InFileScores.Instance, this._movement); this._sampleGameEngine = new GameEngine(this._gameEngineSettings); }
public CoreEngine(IUIEngine uiEngine, IField field, IPlayer player, IActionProvider actionProvider = null, IMovement movement = null, ISolvedChecker solvedChecker = null) { this._uiEngine = uiEngine; this._inputProvider = uiEngine.InputProvider; this._field = field; this._player = player; this._highScores = HighScores.Instance; this.ActionProvider = actionProvider ?? new DefaultActionProvider(this); this.Movement = movement ?? new BackwardMovement(field); this.SolvedChecker = solvedChecker ?? new DefaultSolvedChecker(); this.AttachUIToEvents(); }
// Устанавливает класс управляющий персонажем public void setMovementType(EMovementType movementType) { if (this.movementType.Equals(movementType)) return; this.movementType=movementType; switch(movementType){ case EMovementType.inground: currentMovement = ingroundMovement; break; case EMovementType.inwater: currentMovement = inwaterMovement; break; case EMovementType.underwater: currentMovement = underwaterMovement; break; } }
//starts everything public void Run() { while (this._server.Finished == false && this._server.Errored == false) { _mapBuilder = new DefaultMapBuilder(_server); _tactic = new SurvivalGoldRush(_mapBuilder); _movement = new DefaultMovement(_mapBuilder); var destination = _tactic.NextDestination(); var route = _movement.GetShortestCompleteRouteToLocation(destination.Location); var direction = this._server.GetDirection(_mapBuilder.HeroNode.Location, route.Any() ? route.First().Location : null); this._server.MoveHero(direction); Console.Out.WriteLine("completed turn " + this._server.CurrentTurn); } if (this._server.Errored) { Console.Out.WriteLine("error: " + this._server.ErrorText); } Console.Out.WriteLine("{0} Finished", BotName); }
public void WhenInputIsParsed() { _movement = _parser.GetNextMovement(); }
public void Idle(IMovement movement, Vector2 InputMove) { movement.SetMovement(InputMove); }
public MovementResource EnrichMovement(IMovement movement) { var enricher = new MovementResourceEnricher(_linkProvider, _mapper, _linkGenerator, _httpContext); return(enricher.Enrich(movement)); }
private void Awake() { movement = GetComponent <IMovement> (); destructible = GetComponent <IDestructible> (); }
// Use this for initialization void Start() { moveScript = gameObject.GetComponent <IMovement>(); }
public void SetMovement(IMovement _movementType) { movementType = _movementType; }
private void UpdateUnitTarget(IMovement unit) { unit.Target = GetNewTarget(); unit.Path = GameGrid.Instance.FindPath(unit.Position, unit.Target); }
void Awake() { controller = GetComponent <IController2D>(); stateMachine = GetComponent <ITerrainState>(); move = GetComponent <IMovement>(); }
public Handler(IMovement mover, IRotation rotation) { Movement = mover; Rotation = rotation; }
public bool IsWithinAttackRange(IMovement target) => SqrDistance(movement.Coord, target.Coord) <= sqrRange; //TODO: check if coord == coord.Normalized is more performant
private double GetDeviation(IMovement movement) { IMovement differenceMov = new BiUniversalMovement(varianceData.MeanMovement, movement, (g1, g2) => new DifferenceGraph(g1, g2)); return(differenceMov.GetSumOfAreasOfSubgraphs(samplingFrequency)); }
// Use this for initialization void Start() { _movement = movement.GetComponent <IMovement>(); }
public Rover(IMovement movement) { _position = new Position(0, 0); _movement = movement; }
void Awake() { stats = GetComponent <EnemyStats>(); movement = GetComponent <IMovement>(); }
public MovementRequest(IEntity mover, IMovement movement ) { _mover = mover; _movement = movement; }
public UDMovement(IMovement _movement) { movement = _movement; }
private void Awake() { movement = GetComponent <IMovement>(); }
public IMovement NewMovement(IMovement Movement) { MovementList.Add(Movement); return(Movement); }
public LRMovement(IMovement _movement) { movement = _movement; }
public Hero(IHeroFactory fact) { Weapon = fact.GetHit(); Movement = fact.GetMovement(); }
public Hero(HeroFactory factory) { ability = factory.CreateAbility(); movement = factory.CreateMovement(); }
public void captureMovement(IMovement newMovement) { movement = newMovement; }
void Awake() { player = GameObject.Find("Player").transform; movement = GetComponent <IMovement>(); }
void Awake() { _input = new IAInput(this); _movement = new Movement(GetComponent<Rigidbody2D>()); }
void Start() { actions = playerHands.GetComponent<Actions>(); movementType = EMovementType.inground; // инициализируем контроллеры движения ingroundMovement = gameObject.GetComponent<IngroundMovements>(); if (ingroundMovement==null) ingroundMovement = gameObject.AddComponent<IngroundMovements>(); ingroundMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); underwaterMovement = gameObject.GetComponent<UnderwaterMovements>(); if (underwaterMovement == null) underwaterMovement = gameObject.AddComponent<UnderwaterMovements>(); underwaterMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); inwaterMovement = gameObject.GetComponent<InwaterMovements>(); if (inwaterMovement == null) inwaterMovement = gameObject.AddComponent<InwaterMovements>(); inwaterMovement.setUp(actions, mouseLook, fovKick, headBob, jumpBob, attackController); currentMovement = ingroundMovement; }
void Awake() { _input = new IAInput(this); _movement = new Peasant.Movement(GetComponent<Rigidbody2D>()); _state = State.Moving; }
private void Awake() { _lastSignHorizontalMovement = (int)Mathf.Sign(transform.localScale.x); _playerInput = GetComponent <IPlayerInput>(); _movement = GetComponent <IMovement>(); }
private void InitPlayerMovement() { playerMovement = new PlayerMovement(playerView, playerData); }
private void Awake() { setUpReferences(); movement = new GroundMovement(transform, characterController, camera, animatorManager, speed); }
public EnemyBehaviours AddMovement(IMovement m) { movementOptions.Add(m); return(this); }
private void Awake() { _playerInput = GetComponent <IPlayerInput>(); _movement = GetComponent <IMovement>(); }
public EnemyBehaviours AddMovementChange(IMovement m) { changeOptions.Add(m); return(this); }
public void SetNewStrategies(IController newControl, IMovement newMovement) { _control.SetController(newControl); _currentStrategy = newMovement; }
void releasePlayer(IMovement movement) { triggerable.stopTrigger (0); player.captureMovement (movement); horizontalInput = 0; hasCapturedMovement = false; dragon.stopMoving (); wheelSounds.Stop (); }
public void Movement(IMovement movement) { movement.Move(); }