Skip to content

Commit

Permalink
Provide more fixes and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirKhil committed Dec 2, 2024
1 parent d0e124a commit 85508e0
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 164 deletions.
2 changes: 0 additions & 2 deletions src/SICore/SICore/Clients/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public abstract class Data : INotifyPropertyChanged
/// </summary>
public TableInfo TInfo { get; } = new();

public object TInfoLock { get; } = new object();

/// <summary>
/// Currently played theme index.
/// </summary>
Expand Down
15 changes: 0 additions & 15 deletions src/SICore/SICore/Clients/Other/PersonAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,6 @@ public Account[] Others

public bool IsShowman { get; set; }

private bool isExtendedMode = false;

public bool IsExtendedMode
{
get { return isExtendedMode; }
set
{
if (isExtendedMode != value)
{
isExtendedMode = value;
OnPropertyChanged();
}
}
}

private bool _isDeciding;

public bool IsDeciding
Expand Down
12 changes: 6 additions & 6 deletions src/SICore/SICore/Clients/Player/PlayerComputerLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,17 @@ private void AnswerTask()
{
if (firstSelectionStage)
{
for (themeIndex = 0; themeIndex < table.Count; themeIndex++)
for (var i = 0; i < table.Count; i++)
{
canSelectTheme[themeIndex] = table[themeIndex].Questions.Any(QuestionHelper.IsActive);
canSelectTheme[i] = table[i].Questions.Any(QuestionHelper.IsActive);
}
}
else
{
// Theme is already defined
for (questionIndex = 0; questionIndex < table[themeIndex].Questions.Count; questionIndex++)
for (var i = 0; i < table[themeIndex].Questions.Count; i++)
{
canSelectQuestion[questionIndex] = table[themeIndex].Questions[questionIndex].IsActive();
canSelectQuestion[i] = table[themeIndex].Questions[i].IsActive();
}
}
}
Expand All @@ -557,9 +557,9 @@ private void AnswerTask()
else
{
// Question is already defined
for (themeIndex = 0; themeIndex < table.Count; themeIndex++)
for (var i = 0; i < table.Count; i++)
{
canSelectTheme[themeIndex] = table[themeIndex].Questions.Count > questionIndex && table[themeIndex].Questions[questionIndex].Price > -1;
canSelectTheme[i] = table[i].Questions.Count > questionIndex && table[i].Questions[questionIndex].Price > -1;
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions src/SICore/SICore/Clients/Viewer/IViewerClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ public interface IViewerClient : IActor

string? Avatar { get; set; }

event Action PersonConnected;

event Action PersonDisconnected;

event Action<int, string, string> Timer;

void GetInfo();

void Pause();
Expand All @@ -41,10 +35,6 @@ public interface IViewerClient : IActor

event Action<string?> Ad;

event Action<bool> IsPausedChanged;

event Action IsHostChanged;

void RecreateCommands();

void Say(string text, string whom = NetworkConstants.Everybody, bool isPrivate = false);
Expand Down
8 changes: 7 additions & 1 deletion src/SICore/SICore/Clients/Viewer/IViewerLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void OnTextShape(string[] mparams) { }

void OnTimeChanged();

void OnTimerChanged(int timerIndex, string timerCommand, string arg, string person);
void OnTimerChanged(int timerIndex, string timerCommand, string arg, string? person = null);

void OnPersonFinalStake(int playerIndex);

Expand Down Expand Up @@ -279,4 +279,10 @@ void OnQuestionSelected() { }
void OnGameClosed() { }

void OnCanPressButton() { }

void OnPersonConnected() { }

void OnPersonDisconnected() { }

void OnHostChanged() { }
}
Loading

0 comments on commit 85508e0

Please sign in to comment.