/// <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);
		}
Exemplo n.º 3
0
 void Awake()
 {
     _input = new Input(transform);
     _movement = new Movement(GetComponent<Rigidbody2D>());
     _state = State.Idle;
     _animator = GetComponentInChildren<Animator>();
 }
Exemplo n.º 4
0
        public Player(IMovement movement, IEntityFactory networkPlayer, ICurrentNode currentNode, string name)
        {
            currentNode.SetName(name);
            networkPlayer.CreateNetworkingPlayer();

            _name = name;
        }
Exemplo n.º 5
0
 // 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> ();
 }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 8
0
 /// <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);
		}
Exemplo n.º 10
0
		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();
		}
Exemplo n.º 11
0
        // Устанавливает класс управляющий персонажем
        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;
            }
        }
Exemplo n.º 12
0
        //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);
        }
Exemplo n.º 13
0
 public void WhenInputIsParsed()
 {
     _movement = _parser.GetNextMovement();
 }
Exemplo n.º 14
0
 public void Idle(IMovement movement, Vector2 InputMove)
 {
     movement.SetMovement(InputMove);
 }
Exemplo n.º 15
0
        public MovementResource EnrichMovement(IMovement movement)
        {
            var enricher = new MovementResourceEnricher(_linkProvider, _mapper, _linkGenerator, _httpContext);

            return(enricher.Enrich(movement));
        }
Exemplo n.º 16
0
 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;
 }
Exemplo n.º 19
0
 private void UpdateUnitTarget(IMovement unit)
 {
     unit.Target = GetNewTarget();
     unit.Path   = GameGrid.Instance.FindPath(unit.Position, unit.Target);
 }
Exemplo n.º 20
0
 void Awake()
 {
     controller   = GetComponent <IController2D>();
     stateMachine = GetComponent <ITerrainState>();
     move         = GetComponent <IMovement>();
 }
Exemplo n.º 21
0
 public Handler(IMovement mover, IRotation rotation)
 {
     Movement = mover;
     Rotation = rotation;
 }
Exemplo n.º 22
0
 public bool IsWithinAttackRange(IMovement target) =>
 SqrDistance(movement.Coord, target.Coord) <= sqrRange; //TODO: check if coord == coord.Normalized is more performant
Exemplo n.º 23
0
        private double GetDeviation(IMovement movement)
        {
            IMovement differenceMov = new BiUniversalMovement(varianceData.MeanMovement, movement, (g1, g2) => new DifferenceGraph(g1, g2));

            return(differenceMov.GetSumOfAreasOfSubgraphs(samplingFrequency));
        }
Exemplo n.º 24
0
 // Use this for initialization
 void Start()
 {
     _movement = movement.GetComponent <IMovement>();
 }
Exemplo n.º 25
0
 public Rover(IMovement movement)
 {
     _position = new Position(0, 0);
     _movement = movement;
 }
Exemplo n.º 26
0
 void Awake()
 {
     stats    = GetComponent <EnemyStats>();
     movement = GetComponent <IMovement>();
 }
Exemplo n.º 27
0
 public MovementRequest(IEntity mover, IMovement movement )
 {
     _mover = mover;
     _movement = movement;
 }
Exemplo n.º 28
0
 public UDMovement(IMovement _movement)
 {
     movement = _movement;
 }
Exemplo n.º 29
0
 private void Awake()
 {
     movement = GetComponent <IMovement>();
 }
Exemplo n.º 30
0
 public IMovement NewMovement(IMovement Movement)
 {
     MovementList.Add(Movement);
     return(Movement);
 }
Exemplo n.º 31
0
 public LRMovement(IMovement _movement)
 {
     movement = _movement;
 }
Exemplo n.º 32
0
 public Hero(IHeroFactory fact)
 {
     Weapon   = fact.GetHit();
     Movement = fact.GetMovement();
 }
Exemplo n.º 33
0
 public Hero(HeroFactory factory)
 {
     ability  = factory.CreateAbility();
     movement = factory.CreateMovement();
 }
Exemplo n.º 34
0
 public void captureMovement(IMovement newMovement)
 {
     movement = newMovement;
 }
Exemplo n.º 35
0
 void Awake()
 {
     player   = GameObject.Find("Player").transform;
     movement = GetComponent <IMovement>();
 }
Exemplo n.º 36
0
 void Awake()
 {
     _input = new IAInput(this);
     _movement = new Movement(GetComponent<Rigidbody2D>());
 }
Exemplo n.º 37
0
        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;
        }
Exemplo n.º 38
0
 void Awake()
 {
     _input = new IAInput(this);
     _movement = new Peasant.Movement(GetComponent<Rigidbody2D>());
     _state = State.Moving;
 }
Exemplo n.º 39
0
 private void Awake()
 {
     _lastSignHorizontalMovement = (int)Mathf.Sign(transform.localScale.x);
     _playerInput = GetComponent <IPlayerInput>();
     _movement    = GetComponent <IMovement>();
 }
Exemplo n.º 40
0
 private void InitPlayerMovement()
 {
     playerMovement = new PlayerMovement(playerView, playerData);
 }
Exemplo n.º 41
0
 private void Awake()
 {
     setUpReferences();
     movement = new GroundMovement(transform, characterController, camera, animatorManager, speed);
 }
Exemplo n.º 42
0
 public EnemyBehaviours AddMovement(IMovement m)
 {
     movementOptions.Add(m);
     return(this);
 }
Exemplo n.º 43
0
 private void Awake()
 {
     _playerInput = GetComponent <IPlayerInput>();
     _movement    = GetComponent <IMovement>();
 }
Exemplo n.º 44
0
 public EnemyBehaviours AddMovementChange(IMovement m)
 {
     changeOptions.Add(m);
     return(this);
 }
 public void SetNewStrategies(IController newControl, IMovement newMovement)
 {
     _control.SetController(newControl);
     _currentStrategy = newMovement;
 }
Exemplo n.º 46
0
Arquivo: Wheel.cs Projeto: zillix/LD33
    void releasePlayer(IMovement movement)
    {
        triggerable.stopTrigger (0);

        player.captureMovement (movement);
        horizontalInput = 0;
        hasCapturedMovement = false;
        dragon.stopMoving ();

        wheelSounds.Stop ();
    }
Exemplo n.º 47
0
 public void Movement(IMovement movement)
 {
     movement.Move();
 }