Ejemplo n.º 1
0
    public void AddMatchHistory(bool won, int moves, int elapsedSeconds)
    {
        DateTime date = DateTime.Now;

        SelectedLevel.AddNewMatch(won, moves, date, elapsedSeconds);
        SelectedLevel.SaveToFile();
    }
Ejemplo n.º 2
0
        private void TransferInputs()
        {
            if (SelectedLevel == null || _Process == null || _Process.HasExited)
            {
                return;
            }

            dataGridViewInputs.EndEdit();
            var tasInputs = SelectedLevel.GetJazz2Inputs();

            WinApi.WriteProcessMemory(_Process.Handle, _TASInputsPointer, tasInputs, tasInputs.Length, out int bytesWritten);
        }
Ejemplo n.º 3
0
        public void MergeFrom(Match other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Guid.Length != 0)
            {
                Guid = other.Guid;
            }
            players_.Add(other.players_);
            if (other.selectedLevel_ != null)
            {
                if (selectedLevel_ == null)
                {
                    SelectedLevel = new global::TournamentAssistantShared.Models.PreviewBeatmapLevel();
                }
                SelectedLevel.MergeFrom(other.SelectedLevel);
            }
            if (other.selectedCharacteristic_ != null)
            {
                if (selectedCharacteristic_ == null)
                {
                    SelectedCharacteristic = new global::TournamentAssistantShared.Models.Characteristic();
                }
                SelectedCharacteristic.MergeFrom(other.SelectedCharacteristic);
            }
            if (other.SelectedDifficulty != global::TournamentAssistantShared.Models.BeatmapDifficulty.Easy)
            {
                SelectedDifficulty = other.SelectedDifficulty;
            }
            switch (other.LeaderCase)
            {
            case LeaderOneofCase.Coordinator:
                if (Coordinator == null)
                {
                    Coordinator = new global::TournamentAssistantShared.Models.Coordinator();
                }
                Coordinator.MergeFrom(other.Coordinator);
                break;

            case LeaderOneofCase.Player:
                if (Player == null)
                {
                    Player = new global::TournamentAssistantShared.Models.Player();
                }
                Player.MergeFrom(other.Player);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Ejemplo n.º 4
0
 // Keep the object to reference in the actual level so we can know which turrets are being used
 private void Awake()
 {
     DontDestroyOnLoad(gameObject);
     if (instance != null)
     {
         //selectedTurrets = new List<TurretBlueprint>(instance.selectedTurrets);
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Ejemplo n.º 5
0
    private void Awake()
    {
        _GAME_MANAGER = this;

        _gameStatus    = GameStatus.InTitle;
        _selectedLevel = SelectedLevel.None;
        _playerRole    = PlayerRole.None;

        UITitle.SetActive(true);
        UIRole.SetActive(false);
        UILevel.SetActive(false);

        DontDestroyOnLoad(this);
    }
Ejemplo n.º 6
0
        public Level GetNextLevel()
        {
            if (DailyChallenge)
            {
                return(SelectedLevel);
            }

            if (CurrentLevel >= SelectedChapterLevels.Length)
            {
                CurrentLevel = SelectedChapterLevels.Length - 1;
            }
            SelectedLevel = SelectedChapterLevels[CurrentLevel];
            SelectedLevel.Reset();
            return(SelectedLevel);
        }
Ejemplo n.º 7
0
 //overload for debug
 public void GoToLevel(GameObject _selectedPlanet, GameObject _selectedLevel) //debug function potentially extend to any level
 {
     selectedPlanet             = new SelectedPlanet(_selectedPlanet);        //new select planet
     planet                     = selectedPlanet.selectedPlanet;
     selectedLevel              = new SelectedLevel(_selectedLevel);
     playerScript.selectedLevel = selectedLevel;
     originalDistance           = Vector3.Distance(playerTransform.position, selectedLevel.playerInBattleStartingPosition.transform.position); // calculate the distance before entering function
     selectedLevel.selectedLevel.SetActive(true);
     selectedLevel.enemiesToActivate.SetActive(true);                                                                                          //activate enemies
     selectedLevel.puzzlePiecesHolder.SetActive(true);                                                                                         //activate enemies
     DisplayTheText("arrived" + selectedLevel.selectedLevel.name);
     playerScript.allowedToHit = true;
     currentPlayerState        = PlayerState.inBattle;
     player.transform.rotation = selectedLevel.playerInBattleStartingPosition.transform.rotation;
     player.transform.position = selectedLevel.playerInBattleStartingPosition.transform.position;
 }
Ejemplo n.º 8
0
 public void SelectLevel(GameObject _selectedLevel)   // level is passed as an object, we're going through the tree to pull the relevant objects.
 //enemyControlerList = new List<GameObject>();
 {
     selectedLevel = new SelectedLevel(_selectedLevel);
     playerScript.selectedLevel = selectedLevel;
     originalDistance           = Vector3.Distance(playerTransform.position, selectedLevel.playerInBattleStartingPosition.transform.position);// calculate the distance before entering function
     unpause = .15f;
     playerScript.AnimationByHash(playerScript.flyOldHash);
     if (goToLevel != null)
     {
         StopCoroutine(goToLevel);
     }
     goToLevel = StartCoroutine(GoToLevel());
     //loader.levelKey = selectedPlanet.selectedPlanet.name+selectedLevel.name;
     //loader.SaveData (loader.saveFileName);
     //playerCamera.transform.parent = null; //remove the camera from the parent
     // currentPlayerState = PlayerState.travelToBattle; //set state
 }
Ejemplo n.º 9
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Guid.Length != 0)
            {
                hash ^= Guid.GetHashCode();
            }
            hash ^= players_.GetHashCode();
            if (leaderCase_ == LeaderOneofCase.Coordinator)
            {
                hash ^= Coordinator.GetHashCode();
            }
            if (leaderCase_ == LeaderOneofCase.Player)
            {
                hash ^= Player.GetHashCode();
            }
            if (selectedLevel_ != null)
            {
                hash ^= SelectedLevel.GetHashCode();
            }
            if (selectedCharacteristic_ != null)
            {
                hash ^= SelectedCharacteristic.GetHashCode();
            }
            if (SelectedDifficulty != global::TournamentAssistantShared.Models.BeatmapDifficulty.Easy)
            {
                hash ^= SelectedDifficulty.GetHashCode();
            }
            hash ^= (int)leaderCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 10
0
 public void UpdateSelectedLevel(int level)
 {
     _selectedLevel = (SelectedLevel)level;
 }