コード例 #1
0
        public AjaxApiController()
        {
            DataContext context = new DataContext();

            postOperations    = new PostOperations(context);
            userOperations    = new UserOperations(context);
            requestOperations = new RequestOperations(context);
        }
コード例 #2
0
        public ProfileController()
        {
            DataContext context = new DataContext();

            userOperations    = new UserOperations(context);
            postOperations    = new PostOperations(context);
            friendOperations  = new FriendsOperations(context);
            requestOperations = new RequestOperations(context);
        }
コード例 #3
0
 /// <summary>
 ///  Send new position to the server.
 /// </summary>
 private void UpdateNetworkPosition()
 {
     if (!IsWorthNotifiyingServer())
     {
         return;
     }
     m_LastSendTime   = Time.time;
     m_LastSendVector = transform.position;
     RequestOperations.MoveRequest(transform.position);
 }
コード例 #4
0
        /// <summary>
        ///  Called by button click.
        /// </summary>
        public void OnEnterWorldClick()
        {
            var characterSettings = m_CharacterCreationController.GetCharacterSetting();

            if (characterSettings == null)
            {
                Debug.LogError("No username entered");
                return;
            }

            RequestOperations.EnterWorldRequest(characterSettings);
            ResponseOperations.EnterWorldEvent += OnEnteredWorldResponse;
        }
コード例 #5
0
        private void RequestAutoAttack(Vector3 lookDirection)
        {
            ResponseOperations.AddActionToResponseWaitinglist(m_AutoAttackAction, new Action(() => PerformAutoAttack(lookDirection)));
            switch (m_AutoAttackAction)
            {
            case ActionCode.AxeAutoAttack:
                RequestOperations.AxeAutoAttackRequest(lookDirection);
                break;

            case ActionCode.BowAutoAttack:
                RequestOperations.BowAutoAttackRequest(lookDirection);
                break;
            }
        }
コード例 #6
0
 private void LogCounters()
 {
     m_CurrentWriter.WriteLine("Move/s: {0}, FilteredMove/s: {1}, PercentFiltered: {2}",
                               m_TmpMoveCounter,
                               m_TmpFiltMoveCounter,
                               (float)m_TmpFiltMoveCounter / (float)(m_TmpFiltMoveCounter + m_TmpMoveCounter)
                               );
     m_LogCounter--;
     if (m_Dynmode && m_LogCounter == 5)
     {
         RequestOperations.DistractingShotRequest(new Vector3(1F, 0, 1F));
     }
     if (m_LogCounter == 0)
     {
         FinishLogging();
     }
 }
コード例 #7
0
    private void Update()
    {
        if (Input.GetButtonDown(ToggleAiKey))
        {
            RequestOperations.ToggleAiLoopRequest();
            StartLogging();
        }

        if (Input.GetKeyDown(KeyCode.L))
        {
            m_Dynmode = !m_Dynmode;
        }

        if (Time.time - m_LastUpdateTime >= 1F)
        {
            m_LastUpdateTime = Time.time;
            UPSevent(m_TmpMoveCounter, m_TmpFiltMoveCounter);
            if (m_Logging)
            {
                LogCounters();
            }
            ResetCounters();
        }
    }
コード例 #8
0
    private void SkillCalled(ActionCode skill)
    {
        // TODO: Refactor with strategy pattern.

        //No target skills
        switch (skill)
        {
        case ActionCode.Dash:
            RequestOperations.DashRequest();
            break;

        case ActionCode.HammerBash:
            var hbAction = new Action(() => CastSkill(skill, Vector3.back, 1f));
            ResponseOperations.AddActionToResponseWaitinglist(skill, hbAction);
            RequestOperations.HammerBashRequest();
            break;
        }

        //Character target skills
        switch (skill)
        {
        case ActionCode.DistractingShot:
            var mousePoint = InputExtension.GetMouseHitGroundPoint();
            if (mousePoint == null)
            {
                return;
            }

            var forwardVec = mousePoint.Value - m_Player.transform.position;
            forwardVec = forwardVec.normalized;
            var dsAction = new Action(() => CastSkill(skill, mousePoint.Value, 0.5f));
            ResponseOperations.AddActionToResponseWaitinglist(skill, dsAction);
            RequestOperations.DistractingShotRequest(forwardVec);
            break;

        case ActionCode.OrisonOfHealing:
            if (GameData.Target != null || m_TargetSelector.SetTarget())
            {
                var oohAction = new Action(() => CastSkill(skill, GameData.Target.transform.position, 1f));
                ResponseOperations.AddActionToResponseWaitinglist(skill, oohAction);
                RequestOperations.OrisonOfHealingRequest(GameData.Target.name);
                //CastSkill(skill, GameData.Target.transform.position, 1f);
            }
            break;
        }

        //Mouse position as target skills
        switch (skill)
        {
        case ActionCode.FireStorm:
            var mousePoint = InputExtension.GetMouseHitGroundPoint();
            if (mousePoint == null)
            {
                return;
            }

            var action = new Action(() => CastSkill(skill, mousePoint.Value, 2f));
            ResponseOperations.AddActionToResponseWaitinglist(skill, action);
            RequestOperations.FireStormRequest(mousePoint.Value);
            break;
        }
    }