Skip to content

Commit

Permalink
🔥 Prune dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arutiunian committed Jun 27, 2020
1 parent 5693638 commit edb1b80
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 172 deletions.
54 changes: 0 additions & 54 deletions Assets/Scripts/GameController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ void Start()
GameEvents.instance.OnLoose += DoOnLoose;
GameEvents.instance.OnLooseEnd += DoOnLooseEnd;

// GameEvents.instance.OnRemember += DoOnRemember;
// GameEvents.instance.OnRememberEnd += DoOnRememberEnd;

// GameEvents.instance.OnRepeat += DoOnRepeat;
// GameEvents.instance.OnRepeatEnd += DoOnRepeatEnd;

GameEvents.instance.OnHelp += DoOnHelp;

DoOnMenu();
Expand Down Expand Up @@ -125,30 +119,6 @@ private void DoOnMenu()
SwitchTo(menu);
}

/* #################### Remember State #################### */

// private void DoOnRemember()
// {
// GameStore.instance.ResetAfterRemember();

// prepare.Start();
// prepare.Unbind();

// states.ForEach(state => state.Unbind());
// states.Add(prepare);
// states.Add(remember);
// states.ForEach(state => state.Start());

// GameEvents.instance.TriggerCountRestart();
// GameStore.instance.LockLevel();
// }

// private void DoOnRememberEnd()
// {
// GameStore.instance.ResetAfterRememberEnd();
// GameEvents.instance.TriggerPrepare();
// }

/* #################### Prepare State #################### */

private void DoOnPrepare()
Expand Down Expand Up @@ -194,30 +164,6 @@ public void DoOnHelp()
GameEvents.instance.TriggerCountRestart();
}

/* #################### Repeat State #################### */

// private void DoOnRepeat()
// {
// GameStore.instance.ResetAfterRepeat();

// state.Unbind();
// state = repeat;
// state.Start();

// GameEvents.instance.TriggerCountRestart();
// }

// private void DoOnRepeatEnd()
// {
// GameStore.instance.ResetAfterRepeatEnd();

// state.Unbind();
// state = playing;
// state.Start();

// GameEvents.instance.TriggerCountRestart();
// }

/* #################### Win State #################### */

private void DoOnWin()
Expand Down
44 changes: 0 additions & 44 deletions Assets/Scripts/GameEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,50 +138,6 @@ public void TriggerPrepareEnd()
}
}

/* #################### Remember Events #################### */

// public event Action OnRemember;

// public void TriggerRemember()
// {
// if (OnRemember != null)
// {
// OnRemember();
// }
// }

// public event Action OnRememberEnd;

// public void TriggerRememberEnd()
// {
// if (OnRememberEnd != null)
// {
// OnRememberEnd();
// }
// }

/* #################### Repeat Events #################### */

// public event Action OnRepeat;

// public void TriggerRepeat()
// {
// if (OnRepeat != null)
// {
// OnRepeat();
// }
// }

// public event Action OnRepeatEnd;

// public void TriggerRepeatEnd()
// {
// if (OnRepeatEnd != null)
// {
// OnRepeatEnd();
// }
// }

/* #################### Help Events #################### */

public event Action OnHelp;
Expand Down
24 changes: 0 additions & 24 deletions Assets/Scripts/GameStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,6 @@ public void ResetAfterWinEnd()
NextScore();
}

/* #################### Remember State #################### */

// public void ResetAfterRemember()
// {
// timer = REMEMBER_DELAY;
// }

// public void ResetAfterRememberEnd()
// {
// ResetTimer();
// }

/* #################### Repeat State #################### */

// public void ResetAfterRepeat()
// {
// timer = REPEAT_DELAY;
// }

// public void ResetAfterRepeatEnd()
// {
// ResetTimer();
// }

/* #################### Fail State #################### */

public void ResetAfterLoose()
Expand Down
7 changes: 0 additions & 7 deletions Assets/Scripts/RememberState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public override void Unbind()
game.RememberOverlay.SetActive(false);
game.GameOverlay.SetActive(false);
game.HelpButton.SetActive(true);
// GameEvents.instance.OnCountEnd -= DoOnCountEnd;

}

Expand All @@ -20,17 +19,11 @@ protected override void DoOnStart()
game.RememberOverlay.SetActive(true);
game.GameOverlay.SetActive(true);
game.HelpButton.SetActive(false);
// GameEvents.instance.OnCountEnd += DoOnCountEnd;

LogUtils.LogState(GetType().Name);
}

protected override void DoOnUpdate()
{
}

// private void DoOnCountEnd()
// {
// GameEvents.instance.TriggerRememberEnd();
// }
}
7 changes: 0 additions & 7 deletions Assets/Scripts/RepeatState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,17 @@ public override void Unbind()
{
game.RepeatOverlay.SetActive(false);
game.GameOverlay.SetActive(false);
// GameEvents.instance.OnCountEnd -= DoOnCountEnd;
}

protected override void DoOnStart()
{
game.RepeatOverlay.SetActive(true);
game.GameOverlay.SetActive(true);
// GameEvents.instance.OnCountEnd += DoOnCountEnd;

LogUtils.LogState(GetType().Name);
}

protected override void DoOnUpdate()
{
}

// private void DoOnCountEnd()
// {
// GameEvents.instance.TriggerRepeatEnd();
// }
}
1 change: 0 additions & 1 deletion Assets/Scripts/ReplayHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void Update()

public void HandleClick()
{
// GameEvents.instance.TriggerRemember();
GameEvents.instance.TriggerPrepare();
}
}
1 change: 0 additions & 1 deletion Assets/Scripts/StartHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ void Update()

public void HandleClick()
{
// GameEvents.instance.TriggerRemember();
GameEvents.instance.TriggerPrepare();
}
}
34 changes: 0 additions & 34 deletions Assets/Scripts/ToolbarController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ public class ToolbarController : MonoBehaviour
private static readonly char DASH = '–';
private static readonly float FPS = 60f;

// public bool active = true;
private int current = 0;
// private int prev = 0;

public GameObject RadialTimer;
// public Text display;
public Text score;
public Text level;

Expand All @@ -34,7 +31,6 @@ void Update()

private void Restart()
{
// SetActive();
ResetTimerFill();
StartCoroutine(CountdownStart());
StartCoroutine(RadialTimerStart());
Expand All @@ -47,7 +43,6 @@ private float GetTimerStep()

private void DoOnCountRestart()
{
// Show();
StopAllCoroutines();
ResetTimer();
Restart();
Expand All @@ -59,10 +54,6 @@ private IEnumerator RadialTimerStart()
{
while (IsRunning())
{
// if (!active)
// {
// yield break;
// }
RadialTimer.GetComponent<Image>().fillAmount += GetTimerStep();
yield return new WaitForFixedUpdate();
}
Expand All @@ -72,21 +63,14 @@ private IEnumerator CountdownStart()
{
while (IsRunning())
{
// if (!active)
// {
// yield break;
// }
// UpdateText();
yield return new WaitForSeconds(1f);
DecrementTimer();
}
// UpdateText();
GameEvents.instance.TriggerCountEnd();
}

private void ResetTimer()
{
// prev = current;
current = GameStore.instance.timer;
}

Expand All @@ -102,14 +86,6 @@ private bool IsRunning()

private void UpdateScoreText()
{
// if (GameStore.instance.win || GameStore.instance.loose)
// {
// display.text = prev.ToString();
// }
// else
// {
// display.text = current.ToString();
// }
score.text = GameStore.instance.score.ToString();
}

Expand All @@ -120,16 +96,6 @@ private void UpdateLevelText()
level.text = $"{weight}{DASH}{step}";
}

// private void SetActive()
// {
// active = true;
// }

// private void SetInactive()
// {
// active = false;
// }

public void HideTimer()
{
RadialTimer.SetActive(false);
Expand Down

0 comments on commit edb1b80

Please sign in to comment.