void FightList_FightCreated(FightList fightList, FightControllersContainer fightControllersContainer) { fightControllersContainer.fight.KnifeReady += (Fight fight, int index) => { var controller = fightControllersContainer.GetControllerByIndexInFight(index); _test.Step_AllUsers_WaitForFight_And_SeayReadyToFight.IncrimentCounter(controller.Login); }; fightControllersContainer.fight.Win += (object fight, int winner) => { { var winnderController = fightControllersContainer.GetControllerByIndexInFight(winner); Console.WriteLine("Winer " + winnderController.Login); if (winnderController.Login.Contains("Wolf")) { _test.Step_AllWolfUsers_SendWin.IncrimentCounter(winnderController.Login); } } { var loserController = fightControllersContainer.GetControllerByIndexInFight(1 - winner); if (loserController.Login.Contains("Rabbit")) { _test.Step_AllRabbitUsers_SendFail.IncrimentCounter(loserController.Login); } } }; }
//---methods public Server() { _allUsers = new Dictionary <string, IControllersFactory>(); _userMainController = new List <IMainController>(); _setingsStorage = new SettingsStorage(new TextFileConfig("ToonKnife")); _fightList = new FightList(_setingsStorage); _userFightQueue = new UserFightQueue(); _userFightQueue.UsersReady += UserFightQueue_UserPairReady; //_scsServer = new ScsService.Server.ScsService(5500); //_scsServer.OnUserLogin += ScsServer_OnUserLogin; //_scsServer.OnUserDisconnected += ScsServer_OnUserDisconnected; }
/// <summary> /// </summary> public Timeline(ParseControl parseControl) { Controller = parseControl; FightingRightNow = false; DeathFound = false; Fights = new FightList(); // setup party Overall = new StatGroup("Overall"); Party = new StatGroup("Party") { IncludeSelf = false }; Monster = new StatGroup("Monster") { IncludeSelf = false }; PlayerCurables = new Dictionary <string, int>(); SetStoreHistoryInterval(); InitStats(); StoreHistoryTimer.Elapsed += StoreHistoryTimerOnElapsed; FightingTimer.Elapsed += FightingTimerOnElapsed; }
/// <summary> /// </summary> public Timeline(ParseControl parseControl) { Controller = parseControl; FightingRightNow = false; DeathFound = false; Fights = new FightList(); // setup party Overall = new StatGroup("Overall"); Party = new StatGroup("Party") { IncludeSelf = false }; Monster = new StatGroup("Monster") { IncludeSelf = false }; PlayerCurables = new Dictionary<string, int>(); SetStoreHistoryInterval(); InitStats(); StoreHistoryTimer.Elapsed += StoreHistoryTimerOnElapsed; FightingTimer.Elapsed += FightingTimerOnElapsed; }