Пример #1
0
        public void OnIncreaseExperience(
            string propertyId,
            int value
            )
        {
            if (string.IsNullOrEmpty(_experienceSetting.identifierIncreaseExperienceClientId) ||
                string.IsNullOrEmpty(_experienceSetting.identifierIncreaseExperienceClientSecret))
            {
                Debug.LogError("インストーラーの設定でデバッグ機能が無効化されています");
            }

            StartCoroutine(
                ExperienceController.IncreaseExperience(
                    _session,
                    _experienceSetting.identifierIncreaseExperienceClientId,
                    _experienceSetting.identifierIncreaseExperienceClientSecret,
                    _experienceSetting.experienceNamespaceName,
                    _experienceWatcher.ExperienceModel,
                    propertyId,
                    value,
                    _experienceSetting.onIncreaseExperience,
                    _experienceSetting.onError
                    )
                );
        }
Пример #2
0
 private void Start()
 {
     player = GameObject.FindWithTag(Constants.PLAYER_TAG);
     experienceController = player.GetComponent <ExperienceController>();
     PointsToSpend        = 3;
     gameObject.SetActive(false);
 }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetAxisRaw("Cancel") == 1)
        {
            if (!_cancelAxisInUse)
            {
                _cancelAxisInUse = true;
                if ((!canGoBack && _sceneController.CanGoOneSceneBack()) && !SceneManager.GetActiveScene().name.Equals(StartMenuSceneName))
                {
                    _sceneController.ResetStack();
                    _sceneController.LoadScene(StartMenuSceneName, false);
                }
                else if (!_sceneController.OneSceneBack())
                {
                    CloseGame();
                }
            }
        }
        if (Input.GetAxisRaw("Cancel") != 1)
        {
            _cancelAxisInUse = false;
        }


        if (Input.GetKeyDown(KeyCode.E))
        {
            if (_player != null)
            {
                _player.AddExperience(ExperienceController.GetExperienceForLevel(_player.Level));
            }
        }
    }
Пример #4
0
        public IEnumerator Refresh()
        {
            void RefreshStatuesAction(
                EzExperienceModel experienceModelTemp,
                List <EzStatus> statuses
                )
            {
                if (experienceModelTemp.Name != _experienceModel.Name)
                {
                    return;
                }

                _experienceModel = experienceModelTemp;
                _statuses        = statuses.ToDictionary(status => status.PropertyId);

                _onGetStatuses.RemoveListener(RefreshStatuesAction);
            }

            _onGetStatuses.AddListener(RefreshStatuesAction);

            yield return(ExperienceController.GetStatuses(
                             _client,
                             _session,
                             _experienceNamespaceName,
                             _experienceModel,
                             _onGetStatuses,
                             _onError
                             ));
        }
    // Use this for initialization
    void Start()
    {
        Player player = MainGameController.instance.player;

        _playerName.text  = player.Name;
        _playerLevel.text = player.Level + "";
        int curExperience       = player.Experience;
        int nextLevelExperience = ExperienceController.GetExperienceForLevel(player.Level);

        _playerExperienceTilNextLevelSlider.value = (float)curExperience / (float)nextLevelExperience;
        _playerExperienceTilNextLevelText.text    = curExperience + " / " + nextLevelExperience;
        int totalExperience = 0;

        for (int i = 0; i < player.Level - 1; i++)
        {
            totalExperience += ExperienceController.GetExperienceForLevel(i);
        }
        totalExperience          += curExperience;
        _totalExperienceText.text = totalExperience + "";

        foreach (Property p in MainGameController.instance.databaseController.connection.Table <Property>().ToList())
        {
            CreatePropertyPanel(p);
        }
    }
 /// <summary>
 /// Initialize all gameObjects and controllers for the gameplay controller.
 /// </summary>
 private void InitializeGameplayController()
 {
     gameData = GameObject.Find("Game Data").GetComponent <GameData>();
     liftTrackerController = GameObject.Find("Lift Tracker Controller").GetComponent <LiftTrackerController>();
     lightsController      = GameObject.Find("Lights Controller").GetComponent <LightsController>();
     infoTextController    = GameObject.Find("Info Text Controller").GetComponent <InfoTextController>();
     experienceController  = GameObject.Find("Experience Controller").GetComponent <ExperienceController>();
 }
Пример #7
0
        public IEnumerator Run(
            Client client,
            GameSession session,
            Func <IEnumerator, Coroutine> startCoroutine,
            string experienceNamespaceName,
            string experienceModelName,
            GetExperienceModelEvent onGetExperienceModel,
            GetStatusesEvent onGetStatuses,
            IncreaseExperienceEvent onIncreaseExperience,
            ErrorEvent onError
            )
        {
            if (_watching)
            {
                throw new InvalidOperationException("already started");
            }

            _watching = true;

            _client                  = client;
            _session                 = session;
            _startCoroutine          = startCoroutine;
            _experienceNamespaceName = experienceNamespaceName;
            _experienceModelName     = experienceModelName;
            _onGetExperienceModel    = onGetExperienceModel;
            _onGetStatuses           = onGetStatuses;
            _onIncreaseExperience    = onIncreaseExperience;
            _onError                 = onError;

            void GetExperienceModelAction(
                string experienceModelNameTemp,
                EzExperienceModel experienceModel
                )
            {
                if (_experienceModelName != experienceModelNameTemp)
                {
                    return;
                }

                _experienceModel = experienceModel;

                _onGetExperienceModel.RemoveListener(GetExperienceModelAction);
            }

            _onGetExperienceModel.AddListener(GetExperienceModelAction);

            yield return(ExperienceController.GetExperienceModel(
                             _client,
                             _experienceNamespaceName,
                             _experienceModelName,
                             _onGetExperienceModel,
                             _onError
                             ));

            _onIncreaseExperience.AddListener(OnIncreaseExperience);

            yield return(Refresh());
        }
Пример #8
0
        public ExperienceControllerTests()
        {
            // arrange
            mockRepo   = new Mock <IExperienceRepository>();
            mockLogger = new Mock <ILogger>();



            _autoMapperConfig = new Mapper(new MapperConfiguration(cfg => cfg.AddProfile(new Helpers.AutoMapper())));
            controller        = new ExperienceController(mockLogger.Object, mockRepo.Object, _autoMapperConfig);
        }
Пример #9
0
    public void CheckIfLevelUp()
    {
        int levelUpXp = ExperienceController.GetExperienceForLevel(Level);

        if (Experience > levelUpXp)
        {
            int remainderXp = Experience - levelUpXp;
            Debug.Log("Level Up! Remainder " + remainderXp);
            LevelUp();
            AddExperience(remainderXp);
        }
    }
        public void DeleteExperience()
        {
            // Arrange
            ExperienceController controller = new ExperienceController();

            var actResult = controller.Delete(1);
            // Act
            var result = actResult as OkNegotiatedContentResult <bool>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content == true);
        }
        public void getExperience()
        {
            // Arrange
            ExperienceController controller = new ExperienceController();

            var actResult = controller.Get(1);
            // Act
            var result = actResult as OkNegotiatedContentResult <Experience>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID == 1);
        }
        public void PostExperience()
        {
            // Arrange
            ExperienceController controller = new ExperienceController();

            Experience ExperienceObj = new Experience
            {
                Description = "Portal",
                Comments    = "Good Work",
            };
            var actResult = controller.Post(ExperienceObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <Experience>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID > 0);
        }
        public void PutExperience()
        {
            // Arrange
            ExperienceController controller = new ExperienceController();

            Experience ExperienceObj = new Experience
            {
                Description = "Put request sucessfull",
                Comments    = "Good Work",
                ID          = 1
            };
            var actResult = controller.Put(1, ExperienceObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <Experience>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.Description.Equals("Put request sucessfull"));
        }
Пример #14
0
    public override void Deactivate()
    {
        base.Deactivate();
        PlayerController.Instance.inventory.AddItem(this);

        ExperienceController controller = PlayerController.Instance.experience;

        controller.AddStrenght(-strenghtBonus, true);
        controller.AddStamina(-staminaBonus, true);
        controller.AddMind(-mindBonus, true);
        controller.AddWillpower(-willpowerBonus, true);

        DefenceConfig defence = PlayerController.Instance.defence;

        defence.physical     -= defenceBonus.physical;
        defence.fire         -= defenceBonus.fire;
        defence.ice          -= defenceBonus.ice;
        defenceBonus.electro -= defenceBonus.electro;
    }
Пример #15
0
    public override void Activate()
    {
        base.Activate();
        PlayerController.Instance.inventory.SetWearable(this);
        SoundController.Play("equip");

        ExperienceController controller = PlayerController.Instance.experience;

        controller.AddStrenght(strenghtBonus, true);
        controller.AddStamina(staminaBonus, true);
        controller.AddMind(mindBonus, true);
        controller.AddWillpower(willpowerBonus, true);

        DefenceConfig defence = PlayerController.Instance.defence;

        defence.physical     += defenceBonus.physical;
        defence.fire         += defenceBonus.fire;
        defence.ice          += defenceBonus.ice;
        defenceBonus.electro += defenceBonus.electro;
    }
Пример #16
0
        /// <summary>
        /// Starts the application.
        /// </summary>
        /// <param name="config">Options to run with.</param>
        /// <returns></returns>
        private static async Task Run(MambaConfiguration config)
        {
            using (var experience = new ExperienceController(new ExperienceControllerConfig
            {
                AppId = config.ExperienceId,
                TrellisToken = config.Token,
                TrellisUrl = config.TrellisUrl
            }))
            {
                ElementData elements;
                // load experience first
                try
                {
                    elements = await experience.Initialize();
                }
                catch (Exception exception)
                {
                    Log.Error($"Could not initialize experience: '{exception}'.");

                    return;
                }

                using (var network = new MyceliumController(new MyceliumControllerConfiguration
                {
                    Ip = config.MyceliumIp,
                    Port = config.MyceliumPort,
                    Token = config.Token
                }))
                {
                    using (var kinect = new KinectController(new KinectControllerConfiguration(), network, elements))
                    {
                        network.Start();
                        kinect.Start();

                        Console.ReadLine();

                        Log.Information("Shutting down.");
                    }
                }
            }
        }
Пример #17
0
        public ExperianceController()
        {
            IUnitOfWork uow = new UnitOfWork();

            _controller = new ExperienceController(uow);
        }
Пример #18
0
        public PracticeControllerTest()
        {
            IUnitOfWork uow = new UnitOfWork();

            _controller = new ExperienceController(uow);
        }
Пример #19
0
 private void Awake()
 {
     expControl = GetComponent <ExperienceController>();
 }
Пример #20
0
 public DetailsModel(RandyPowell.Models.RandyPowellContext context)
 {
     _context = context;
     excon    = new ExperienceController(_context);
 }