Resolve WES-181 "Missing code doc"
This commit is contained in:
committed by
Louis Adriaens
parent
7505ae7262
commit
3d99184717
@@ -6,6 +6,9 @@ using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
/// <summary>
|
||||
/// The Hangman game controller
|
||||
/// </summary>
|
||||
public class HangmanController : AbstractMinigameController
|
||||
{
|
||||
[Header("ConcreteVariables")]
|
||||
@@ -166,11 +169,6 @@ public class HangmanController : AbstractMinigameController
|
||||
/// </summary>
|
||||
public TMP_Text confirmText;
|
||||
|
||||
///// <summary>
|
||||
///// Temporary reference to timer to turn it off
|
||||
///// </summary>
|
||||
//public GameObject timer;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum length of the words
|
||||
/// </summary>
|
||||
@@ -249,9 +247,6 @@ public class HangmanController : AbstractMinigameController
|
||||
|
||||
scoreDisplay.text = $"Score: {CalculateScore()}";
|
||||
scoreBonus.text = "";
|
||||
|
||||
// Temporary
|
||||
//timer.SetActive(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -286,9 +281,6 @@ public class HangmanController : AbstractMinigameController
|
||||
|
||||
confirmPanel.SetActive(false);
|
||||
signPredictor.SwapScreen(script.webcamScreen);
|
||||
|
||||
//temporarily turn off timer in input-mode
|
||||
//timer.SetActive(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -335,6 +327,7 @@ public class HangmanController : AbstractMinigameController
|
||||
StartGame();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update is called once per frame
|
||||
/// </summary>
|
||||
@@ -371,6 +364,7 @@ public class HangmanController : AbstractMinigameController
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Functionality to be called when the backspace-key is pressed during input-mode
|
||||
/// </summary>
|
||||
@@ -384,6 +378,7 @@ public class HangmanController : AbstractMinigameController
|
||||
}
|
||||
Input.ResetInputAxes();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles sign logic, so that it does not have to run every frame
|
||||
/// This function is called when the UpdateFeedback has accepted a letter
|
||||
@@ -417,6 +412,7 @@ public class HangmanController : AbstractMinigameController
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Takes the currentSign and tries to enter it into the word if playing
|
||||
/// When in input-mode it will just add the letter to the currentWord
|
||||
@@ -469,6 +465,7 @@ public class HangmanController : AbstractMinigameController
|
||||
SwitchMode(1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The letter got rejected, start the letter-fetching process again
|
||||
/// </summary>
|
||||
@@ -482,6 +479,7 @@ public class HangmanController : AbstractMinigameController
|
||||
else if (mode == 4)
|
||||
SwitchMode(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Outside function to switch the modes this allows the gameIsactive-logic to be properly attached to the modes
|
||||
/// </summary>
|
||||
@@ -499,6 +497,7 @@ public class HangmanController : AbstractMinigameController
|
||||
gameIsActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change the image that is being displayed
|
||||
/// </summary>
|
||||
@@ -515,6 +514,7 @@ public class HangmanController : AbstractMinigameController
|
||||
scoreBonus.text = $"{INCORRECT_LETTER_SCORE}";
|
||||
scoreBonus.color = new Color(0xf5 / 255.0f, 0x49 / 255.0f, 0x3d / 255.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In this function, the letters of the word selected in DisplayWord are updated after a correct guess.
|
||||
/// </summary>
|
||||
@@ -542,6 +542,7 @@ public class HangmanController : AbstractMinigameController
|
||||
scoreBonus.text = $"+{hits * CORRECT_LETTER_SCORE}";
|
||||
scoreBonus.color = new Color(0x8b / 255.0f, 0xd4 / 255.0f, 0x5e / 255.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This function returns the score that the user currently has
|
||||
/// </summary>
|
||||
@@ -551,6 +552,7 @@ public class HangmanController : AbstractMinigameController
|
||||
int won = corrects == currentWord.Length ? 1 : 0;
|
||||
return corrects * CORRECT_LETTER_SCORE + wrongs * INCORRECT_LETTER_SCORE + WIN_SCORE * won;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete all letter objects
|
||||
/// </summary>
|
||||
@@ -562,6 +564,7 @@ public class HangmanController : AbstractMinigameController
|
||||
}
|
||||
letters.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays the word that needs to be spelled
|
||||
/// </summary>
|
||||
@@ -581,6 +584,7 @@ public class HangmanController : AbstractMinigameController
|
||||
txt.text = c == ' ' ? "" : Char.ToString('_');
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The logic to process the signs sent by the signPredictor
|
||||
/// </summary>
|
||||
@@ -670,6 +674,7 @@ public class HangmanController : AbstractMinigameController
|
||||
timerCircle.fillAmount = currentTime;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The logic to set the scoreboard of hangman
|
||||
/// </summary>
|
||||
@@ -694,6 +699,7 @@ public class HangmanController : AbstractMinigameController
|
||||
score: CalculateScore()
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The hangman-specific logic that needs to be called at the start of the game
|
||||
/// </summary>
|
||||
@@ -724,27 +730,50 @@ public class HangmanController : AbstractMinigameController
|
||||
|
||||
DeleteWord();
|
||||
}
|
||||
// The following functions are only used for testing
|
||||
|
||||
/// <summary>
|
||||
/// Get this.currentWord, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public string getCurrentWord()
|
||||
{
|
||||
return currentWord;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get this.mode, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public int getCurrentMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get this.corrects, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public int getCorrects()
|
||||
{
|
||||
return corrects;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get this.wrongs, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public int getWrongs()
|
||||
{
|
||||
return wrongs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get this.userLettersText.text, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public string getUsedLetters()
|
||||
{
|
||||
return usedLettersText.text;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get this.currentTime, FOR TESTING ONLY
|
||||
/// </summary>
|
||||
public float getCurrentTime()
|
||||
{
|
||||
return currentTime;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// The hangman-variant of the ScoreBoard
|
||||
/// The Hangman-variant of the ScoreBoard
|
||||
/// </summary>
|
||||
public class HangmanGameEndedPanel : AbstractGameEndedPanel
|
||||
{
|
||||
@@ -23,6 +24,10 @@ public class HangmanGameEndedPanel : AbstractGameEndedPanel
|
||||
/// Letters ( right | wrong )
|
||||
/// </summary>
|
||||
public TMP_Text lettersRightText;
|
||||
|
||||
/// <summary>
|
||||
/// Letters ( right | wrong )
|
||||
/// </summary>
|
||||
public TMP_Text lettersWrongText;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,9 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// The panel for holding the actual game in Hangman
|
||||
/// </summary>
|
||||
public class PanelHangmanGame : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,9 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// The mulitplayer panel for Hangman
|
||||
/// </summary>
|
||||
public class PanelMultiplayerInput : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user