'яносто два c.
. Метью Мак-Дональд C # для професіоналів - М .: Видавничий дім Вільямс raquo ;, 2010. - 656 с.
. Вікіпедія [Електронний ресурс].- Електронні дані.- Режим доступу: # justify gt; Додаток
Лістинг класу NegotiationManager.
System;System.Collections.Generic;System.Drawing;System.Linq;System.Text;System.Threading.Tasks;System.Windows.Forms;BaldaClient.DisplayLogic;BaldaClient.NetworkManagment;BaldaClient.SettingsManagment;BaldaGameLogic.Delegates;BaldaGameLogic.GameLogic;BaldaGameLogic.GameModel;
BaldaClient.Negotiation
{class NegotiationManager
{
# region GameManagment
GameLogicManager gameLogicManager; DisplayManager displayManager; NetworkManager networkManager;
SettingsManager SettingsManager {get; set; } GameLogicControls GameLogicControls {get; set; } bool IsProcessServer {get; set; }
BaldaAplicationForm MainForm
{; ;
}
String ProcessUserName {get; set; }
LogicCell previousLogicCell;
# endregion
# region GameLogicFlags
bool IsCellSelectionExpected
{{return gameLogicManager.IsCellSelectionExpected; } {GameLogicManager.IsCellSelectionExpected=value; }
}
bool IsLetterSelectionExpected
{{return gameLogicManager.IsLetterSelectionExpected; } {GameLogicManager.IsLetterSelectionExpected=value; }
}
bool IsWordSelectionExpected
{{return gameLogicManager.IsWordSelectionExpected; } {GameLogicManager.IsWordSelectionExpected=value; }
}
bool IsSelectedNetworkGameMode
{{return gameLogicManager.IsSelectedNetworkGameMode; } {GameLogicManager.IsSelectedNetworkGameMode=value; }
}
# endregion
List lt; Player gt; Players
{{return gameLogicManager.Players; } {GameLogicManager.Players=value; }
}
List lt; Player gt; TempPlayerList {get; set; }
NegotiationManager (BaldaAplicationForm mainForm)
{= mainForm;=new GameLogicManager ();=new NetworkManager (this);
}
void AddPlayerToTempPlayerList (String userName)
{(TempPlayerList == null)
{= new List lt; Player gt; ();
} (TempPlayerList.FirstOrDefault (pl= gt; pl.Name == userName) == null)
{number=TempPlayerList.Count + 1; .Add (new Player {Name=userName, Number=number});
} (gameLogicManager.Settings.PlayerCount == TempPlayerList.Count)
{. Players=TempPlayerList; .CreateAllPlayersNameControls ();
}
}
void BindGameManagers ()
{. DisplayCells=displayManager.DisplayCells; .DisplayCellAsLight=displayManager.DisplayCellsAsLight; .DisplayCurrentWord=displayManager.DispalyCurrentWord; .DisplayCurrentPlayerName=displayManager.DisplayCurrentPlayerName; .DisplayCurrentGuide=displayManager.DisplayCurrentGuide; .DisplayCurrentError=displayManager.DisplayCurrentError ; .AddWordConfirmationButtons=.GameForm.CreateWordConfirmationLabels; .RemoveConfirmationLabels=GameLogicControls.GameForm.RemoveConfirmationLabels; .AddLetterConfirmationButtons=GameLogicControls.GameForm.AddLetterConfirmationLabels;
}
void ConfigureGame ()
{() ;. CreateGameLogicObjects ();
}
void ConfigureGameSettings ()
{. Settings=SettingsManager.GameLogicSettings;
}
void StartGame ()
{. StartGame () ;. DrawFullMatrix (); ( Балда );
}
void SetFirstWord (string word)
{. SetFirstWord (word);
}
void TrySelectCell (int xCor, int yCor)
{logicCell=displayManager.GetLogicCellByCor (xCor, yCor); (logicCell!=null)
{(gameLogicManager.TrySelectCellForInsertingLetter (logicCell))
{= true;=false;