private void CheckForPhaseChange() { if (AscensionLevel.Value != AscensionLevelForNextPhase) { DebugMessage("Cannot ascend; AscensionLevel = " + AscensionLevel.Value + ", AscensionLevelForNextPhase = " + AscensionLevelForNextPhase); return; } DebugMessage("Ascension occurring!"); // Instantiate the ascension effect... if (!string.IsNullOrEmpty(AscensionEffectPath)) { GameObject ascensionEffect = Resources.Load <GameObject>(AscensionEffectPath); Instantiate(ascensionEffect, transform.position, transform.rotation); } // TODO: Implement a player object pooling manager... MatchEntityManager.InactivatePlayerAvatar(gameObject, PlayerState); if (!string.IsNullOrEmpty(NextPlayerModelName)) { MatchEntityManager.SwitchToNewPlayerAvatar(transform.position, transform.rotation, NextPlayerModelName); } }
private Reptile() { var mem = new MatchEntityManager(); mem.Init(this); matchEntityManager = mem; IocUnity.RegisterInstance("MatchEntityManager", matchEntityManager); socket = new EventSocket(); socket.SocketSink = this; socket.ServerIP = ConfigSingleton.CreateInstance().GetAppConfig <string>("ServerIP"); socket.ServerPort = ConfigSingleton.CreateInstance().GetAppConfig <ushort>("ServerPort"); }
private void CheckForFailure(Collider who) { if (!TagsThatCauseDeath.Contains(who.tag)) { return; } // The thing that collided with us does, in fact, cause death. MatchEntityManager.InactivatePlayerAvatar(gameObject, PlayerState); MatchEntityManager.SpawnMob(transform.position, transform.rotation, DeathModelName); // TODO: Short delay, music change, then show failure UI. GameUIController.ShowFailureUI(); }
public void ParseMatch(string round, HtmlNode table, MatchParam param) { var trs = table.SelectNodes("tbody/tr"); foreach (var tr in trs) { var dtNode = tr.SelectSingleNode("td[@class='datetime']"); if (dtNode == null) { continue; } var matchDate = dtNode.InnerText; var matchIdStr = tr.SelectSingleNode("td/a").Attributes["href"].Value; var homeNode = tr.SelectSingleNode("td/a/img[@class='home']"); var awayNode = tr.SelectSingleNode("td/a/img[@class='away']"); var homeIdStr = homeNode == null ? "" : homeNode.Attributes["src"].Value; var awayIdStr = awayNode == null ? "" : awayNode.Attributes["src"].Value; var p1 = tr.SelectSingleNode("td[@class='p1 ']"); var htResult = p1 == null ? "" : p1.InnerText; var ftResult = tr.SelectSingleNode("td[@class='nt ftx ']").InnerText; var matchId = RegexGetStr(matchIdStr, "matchid', ", ","); var currentMatch = new MatchEntity(); currentMatch.MatchId = matchId; currentMatch.HomeId = RegexGetStr(homeIdStr, "small/", ".png"); currentMatch.AwayId = RegexGetStr(awayIdStr, "small/", ".png"); currentMatch.MatchDate = matchDate; currentMatch.ExtendedData = "Round = " + round; currentMatch.SportId = param.SportId; currentMatch.SeasonId = param.SeasonId; var me = MatchEntityManager.AddOrGetCacheEntity <MatchEntity>(matchId); me.CompareSetMatchInfo(currentMatch); if (!string.IsNullOrEmpty(htResult) || !string.IsNullOrEmpty(ftResult)) { var result = new MatchResultEntity() { MatchId = matchId, Result = htResult + "_" + ftResult, SportId = param.SportId }; me.CompareSetMatchResult(result); } } }
private void CheckForReviveProximity() { if (!ReviveUpdateLockout.CanAttempt()) { return; } ReviveUpdateLockout.NoteLastOccurrence(); RevivableSensor.DetectEntities(); // If nothing has been sensed, do nothing else. // If nothing has been sensed, but something is no longer detected, hide the Revive guage. if (RevivableSensor.HasSensedNothing) { if (RevivableSensor.HasLeft) { DebugMessage("An object that can revive has left the sensor, and nothing else that can is nearby."); GameUIController.ShowRevivingGauge(false); } return; } // If something has just been sensed, show the revive guage. if (RevivableSensor.HasEntered) { GameUIController.ShowRevivingGauge(true); } // If something is being sensed, increment the gauge ReviveStatus.Increase(ReviveRate.Value); FormattedDebugMessage(LogLevel.Info, "Reviving {0}: {1}/{2}", gameObject.name, ReviveStatus.Value, ReviveStatus.ValueCap); GameUIController.UpdateRevivingGauge(ReviveStatus.Value, ReviveStatus.ValueCap); // If the revive is complete, hide the gauge, spawn the revived object. if (ReviveStatus.IsAtMax) { FormattedDebugMessage(LogLevel.Info, "Reviving {0} as {1}", gameObject.name, ReviveModelName); gameObject.SetActive(false); GameUIController.ShowRevivingGauge(false); ScoreManager.NoteChickenRescue(); MatchEntityManager.SpawnMob(transform.position, transform.rotation, ReviveModelName); } }
public override void InitCacheManager() { var organizerEntityManager = new OrganizerEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(OrganizerEntityManager).Name, organizerEntityManager); DicCacheManagers.Add(typeof(OrganizerEntityManager).Name, (ICacheManager)organizerEntityManager); var leagueEntityManager = new LeagueEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(LeagueEntityManager).Name, leagueEntityManager); DicCacheManagers.Add(typeof(LeagueEntityManager).Name, (ICacheManager)leagueEntityManager); var matchEntityManager = new MatchEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(MatchEntityManager).Name, matchEntityManager); DicCacheManagers.Add(typeof(MatchEntityManager).Name, (ICacheManager)matchEntityManager); var playerEntityManager = new PlayerEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(PlayerEntityManager).Name, playerEntityManager); DicCacheManagers.Add(typeof(PlayerEntityManager).Name, (ICacheManager)playerEntityManager); var playerPenaltiesManager = new PlayerPenaltiesManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(PlayerPenaltiesManager).Name, playerPenaltiesManager); DicCacheManagers.Add(typeof(PlayerPenaltiesManager).Name, (ICacheManager)playerPenaltiesManager); var PlayerStatisticsRecordManager = new PlayerStatisticsRecordManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(PlayerStatisticsRecordManager).Name, PlayerStatisticsRecordManager); DicCacheManagers.Add(typeof(PlayerStatisticsRecordManager).Name, (ICacheManager)PlayerStatisticsRecordManager); var playerTimeRecordManager = new PlayerTimeRecordManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(PlayerTimeRecordManager).Name, playerTimeRecordManager); DicCacheManagers.Add(typeof(PlayerTimeRecordManager).Name, (ICacheManager)playerTimeRecordManager); var seasonEntityManager = new SeasonEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(SeasonEntityManager).Name, seasonEntityManager); DicCacheManagers.Add(typeof(SeasonEntityManager).Name, (ICacheManager)seasonEntityManager); var seasonTypeInfoManager = new SeasonTypeInfoManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(SeasonTypeInfoManager).Name, seasonTypeInfoManager); DicCacheManagers.Add(typeof(SeasonTypeInfoManager).Name, (ICacheManager)seasonTypeInfoManager); var seasonTableInfoManager = new SeasonTableInfoManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(SeasonTableInfoManager).Name, seasonTableInfoManager); DicCacheManagers.Add(typeof(SeasonTableInfoManager).Name, (ICacheManager)seasonTableInfoManager); var seasonTeamsManager = new SeasonTeamsManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(SeasonTeamsManager).Name, seasonTeamsManager); DicCacheManagers.Add(typeof(SeasonTeamsManager).Name, (ICacheManager)seasonTeamsManager); var teamEntityManager = new TeamEntityManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(TeamEntityManager).Name, teamEntityManager); DicCacheManagers.Add(typeof(TeamEntityManager).Name, (ICacheManager)teamEntityManager); var teamPlayersManager = new TeamPlayersManager(); IocUnity.RegisterInstance <ICacheManager>(typeof(TeamPlayersManager).Name, teamPlayersManager); DicCacheManagers.Add(typeof(TeamPlayersManager).Name, (ICacheManager)teamPlayersManager); }