void Start() { Button btn; if (null != m_next_level_button) { btn = m_next_level_button.GetComponent <Button>(); btn.onClick.AddListener(on_next_level_button_click); } if (null != m_replay_button) { btn = m_replay_button.GetComponent <Button>(); btn.onClick.AddListener(on_replay_button_click); } if (null != m_quit_button) { btn = m_quit_button.GetComponent <Button>(); btn.onClick.AddListener(on_quit_button_click); } if (null != m_return_button) { btn = m_return_button.GetComponent <Button>(); btn.onClick.AddListener(on_return_button_click); } // GameObject score_center_go = GameObject.Find("ScoreCenter"); // ScoreCenter score_center = score_center_go.AddComponent<ScoreCenter>(); m_highest_score.set_score(ScoreCenter.instance().HighestScore); m_highest_combo_hits.set_score(ScoreCenter.instance().HighestComboHits); }
public override void LoadScore(BaseScore baseScore, ScoreCenter center) { FussballdeScore fsc = baseScore as FussballdeScore; m_center = center; m_iconIndex = 0; errorProvider1.Clear(); tbxScoreId.Text = fsc.Id; tbxName.Text = fsc.Name; tbxUrl.Text = fsc.Url; tbxDetails.Text = fsc.Details; tbxLevels.Text = fsc.Levels; tbxHighlights.Text = fsc.Highlights; if (!String.IsNullOrEmpty(fsc.Image)) { string iconPath = Path.Combine(Config.GetSubFolder(Config.Dir.Thumbs, "ScoreCenter"), fsc.Image + ".png"); if (File.Exists(iconPath)) { pictureBox1.Image = new Bitmap(iconPath); } else { pictureBox1.Image = Properties.Resources.fussballde_logo; } } else { pictureBox1.Image = Properties.Resources.fussballde_logo; } }
private static ScoreDetails GetScoreDetails(WorldFootballScore wfscore, ScoreParameter[] parameters) { string competition = ScoreCenter.GetParameter(parameters, "WF.Competition", KEY_COMPETITION); string home = Tools.ParseUrl(String.Format("{0}{2}/{1}/", WF_URL, wfscore.FullLeagueName, competition), parameters); string html = s_cache.GetScore(home, "", true); ScoreDetails details = new ScoreDetails(wfscore, parameters); // get round string regex = ScoreCenter.GetParameter(parameters, "WF.RoundRegEx", ROUND_REGEX); Regex re = new Regex(regex); Match fm = re.Match(html); int round = 0; int.TryParse(fm.Groups["round"].Value, out round); details.Round = round; // get items HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.OptionReadEncoding = false; doc.LoadHtml(html); HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes("//div[@class='navibox2']//li/a"); if (nodes == null) { throw new ArgumentException("div with class 'navibox2' not found, check site adress and WF.Competition parameter."); } foreach (var node in nodes) { details.AddDetail(node.InnerHtml, node.GetAttributeValue("href", "")); } return(details); }
public override void LoadScore(BaseScore baseScore, ScoreCenter center) { m_center = center; WorldFootballScore score = baseScore as WorldFootballScore; if (score == null) { throw new NullReferenceException("Not a WorldFootballScore score!"); } errorProvider1.Clear(); // always clear tbxName.Clear(); tbxCountry.Clear(); tbxLeague.Clear(); tbxSeason.Clear(); tbxLevels.Clear(); tbxHighlights.Clear(); tbxDetails.Clear(); ckxLiveEnabled.Checked = false; tbxLiveFilter.Clear(); tbxName.Text = score.Name; tbxCountry.Text = score.Country; tbxLeague.Text = score.League; tbxSeason.Text = score.Season; numNbTeams.Value = score.NbTeams; numRounds.Value = score.Rounds; tbxLevels.Text = score.Levels; cbxKind.SelectedValue = score.Kind; tbxHighlights.Text = score.Highlights; tbxDetails.Text = score.Details; tbxScoreId.Text = score.Id; ckxTwoGames.Checked = score.TwoLegs; if (score.LiveConfig != null) { ckxLiveEnabled.Checked = score.LiveConfig.enabled; tbxLiveFilter.Text = score.LiveConfig.filter; } if (!String.IsNullOrEmpty(score.Image)) { string iconPath = Path.Combine(Config.GetSubFolder(Config.Dir.Thumbs, "ScoreCenter"), score.Image + ".png"); if (File.Exists(iconPath)) { pictureBox1.Image = new Bitmap(iconPath); } else { pictureBox1.Image = Properties.Resources.wfb_logo; } } else { pictureBox1.Image = Properties.Resources.wfb_logo; } }
void on_replay_button_click() { ScoreCenter.instance().clear_score(); ScoreCenter.instance().clear_combo_hit_count(); m_scene_switcher.m_scene_name = m_replay_scene_name;// StartCoroutine(m_scene_switcher.LoadYourAsyncScene()); }
public static ScoreCenter instance() { if (null == m_instance) { m_instance = new ScoreCenter(); } return(m_instance); }
public void AddStadiumScore(List <BaseScore> scores, string fullname, int index) { // Stadiums if (this.HasDetail(ScoreCenter.GetParameter(m_parameters, "WF.KeyStadiums", KEY_STADIUMS))) { GenericScore sc = CreateNewScore(m_score.Id, "stadium", "Stadiums", IMG_STADIUM, "0", index); sc.Url = String.Format("{0}spielorte/{1}/", WF_URL, fullname); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.Stadium", SIZES_STADIUM); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(m_parameters, "WF.HeaderStadium", HEADERS_STADIUM); scores.Add(sc); } }
public BaseGame(GameManager gameManager, string scoreUnits, ScoreCenter.SortDirection direction) { this.ScoreUnits = scoreUnits; this.SortDirection = direction; this.GameManager = gameManager; if (null == _unknownTexture) { _unknownTexture = this.GameManager.Game.Content.Load<Texture2D>(@"Textures\logo_unknown"); } this.Logo = _unknownTexture; this.Variation = string.Empty; }
/// <summary> /// Defines a Cup. /// </summary> /// <param name="wfscore">The Worldfootball definition.</param> /// <param name="parameters"></param> /// <returns></returns> private static List <BaseScore> DefineCup(WorldFootballScore wfscore, ScoreParameter[] parameters) { int index = 0; List <BaseScore> scores = new List <BaseScore>(); // add last results score GenericScore sc = CreateNewScore(wfscore.Id, "last", "Last Results", IMG_RESULTS, "2", index++); string competition = ScoreCenter.GetParameter(parameters, "WF.Competition", KEY_COMPETITION); sc.Url = String.Format("{0}{2}/{1}/", WF_URL, wfscore.FullLeagueName, competition); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.CupResults", SIZES_CUP_RESULTS); sc.Dictionary = "WF.last"; sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.AddHighlightRule(wfscore.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); string fullname = wfscore.FullLeagueName; if (String.IsNullOrEmpty(wfscore.Season) == false) { fullname += "-" + wfscore.Season; } // add rounds if any if (!String.IsNullOrEmpty(wfscore.Details)) { string[] rounds = wfscore.Details.Split(','); foreach (string round in rounds) { sc = CreateNewScore(wfscore.Id, round, round, IMG_RESULTS, "0", index++); sc.Url = String.Format("{0}spielplan/{1}-{2}/0/", WF_URL, fullname, round); sc.Sizes = wfscore.TwoLegs && round != "finale" ? ScoreCenter.GetParameter(parameters, "WF.CupLevel2", SIZES_CUP_LEVEL2) : ScoreCenter.GetParameter(parameters, "WF.CupLevel1", SIZES_CUP_LEVEL1); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); scores.Add(sc); } } // add details ScoreDetails details = GetScoreDetails(wfscore, parameters); details.AddTopScorerScore(scores, fullname, index++); details.AddAssistsScore(scores, fullname, index++); details.AddStadiumScore(scores, fullname, index++); details.AddRefereeScore(scores, fullname, index++); details.AddHistoryScore(scores, index++); details.AddTopScorerHistScore(scores, index++); return(scores); }
/// <summary> /// Defines a Team score. /// </summary> /// <param name="wfscore">The Worldfootball definition.</param> /// <param name="parameters"></param> /// <returns></returns> private static List <BaseScore> DefineTeam(WorldFootballScore wfscore, ScoreParameter[] parameters) { int index = 0; List <BaseScore> scores = new List <BaseScore>(); GenericScore sc = null; sc = CreateNewScore(wfscore.Id, "teamlast", "Last", IMG_PREV, "2", index++); sc.Url = String.Format("{0}teams/{1}/", WF_URL, wfscore.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.TeamLast", SIZES_TEAM_LAST); sc.AddHighlightRule(wfscore.Highlights, 3, RuleAction.FormatLine); sc.AddRule(1, Operation.EndsWith, ";", RuleAction.SkipLine, ""); scores.Add(sc); //sc = CreateNewScore(wfscore.Id, "teamresults", "Results", IMG_RESULTS, "0", index++); //sc.Url = String.Format("{0}teams/{1}/{{YYYY+1}}/3/", WF_URL, wfscore.FullLeagueName); //sc.Sizes = GetParameter(parameters, "WF.TeamResults", SIZES_TEAM_RESULTS); //AddHighlightRule(sc, wfscore.Highlights, 3, RuleAction.FormatLine); //AddRule(sc, 2, Operation.IsNull, "", RuleAction.MergeCells, "Header"); //AddRule(sc, 4, Operation.IsNull, "", RuleAction.FormatLine, "Level1"); //scores.Add(sc); List <string> items = wfscore.Details.ToLower().Split(',').ToList(); if (items.Contains("players")) { sc = CreateNewScore(wfscore.Id, "team", "Players", IMG_PLAYER, "4", index++); sc.Url = String.Format("{0}teams/{1}/", WF_URL, wfscore.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.TeamPlayers", SIZES_TEAM_PLAYERS); sc.AddRule(1, Operation.EndsWith, ";", RuleAction.SkipLine, ""); sc.AddRule(2, Operation.IsNull, "", RuleAction.MergeCells, "Header"); scores.Add(sc); } if (items.Contains("transfers")) { sc = CreateNewScore(wfscore.Id, "transfert", "Transfers", IMG_TRANSFERS, "0", index++); sc.Url = String.Format("{0}teams/{1}/{{YYYY+1}}/6", WF_URL, wfscore.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.TeamTransfers", SIZES_TEAM_TRANSFERS); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); scores.Add(sc); } sc = CreateNewScore(wfscore.Id, "teamarchives", "History", IMG_HISTORY, "1", index++); sc.Url = String.Format("{0}teams/{1}/1/", WF_URL, wfscore.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.TeamHistory", SIZES_TEAM_ARCHIVES); sc.AddHighlightRule(wfscore.Highlights, 3, RuleAction.FormatLine); sc.AddRule(1, Operation.Contains, " x ", RuleAction.FormatLine, "Header"); scores.Add(sc); return(scores); }
public void AddHistoryScore(List <BaseScore> scores, int index) { // History if (this.HasDetail(ScoreCenter.GetParameter(m_parameters, "WF.KeyAllWinners", KEY_ALL_WINNERS))) { GenericScore sc = CreateNewScore(m_score.Id, "archives", "History", IMG_HISTORY, "0", index); sc.Url = String.Format("{0}sieger/{1}/", WF_URL, m_score.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.History", SIZES_HISTORY); sc.Skip = 1; sc.Dictionary = "WF.archives"; sc.AddHighlightRule(m_score.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); } }
public void AddRefereeScore(List <BaseScore> scores, string fullname, int index) { // Referee if (this.HasDetail(ScoreCenter.GetParameter(m_parameters, "WF.KeyReferees", KEY_REFEREES))) { GenericScore sc = CreateNewScore(m_score.Id, "referee", "Referees", IMG_REFEREE, "0", index); sc.Url = String.Format("{0}schiedsrichter/{1}/1/", WF_URL, fullname); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.Referee", SIZES_REFEREE); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(m_parameters, "WF.HeaderReferee", HEADERS_REFEREE); sc.AddRule(-1, Operation.IsLast, "1", RuleAction.SkipLine, ""); scores.Add(sc); } }
public void AddTopScorerHistScore(List <BaseScore> scores, int index) { // Top scorer History if (this.HasDetail(ScoreCenter.GetParameter(m_parameters, "WF.KeyTopScorersList", KEY_TOP_SCORERS_LIST))) { GenericScore sc = CreateNewScore(m_score.Id, "scorerhistory", "Top Scorer History", IMG_SCORER_HISTORY, "0", index); sc.Url = String.Format("{0}torschuetzenkoenige/{1}/", WF_URL, m_score.FullLeagueName); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.TopScorerHistory", SIZES_SCORER_HISTORY); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(m_parameters, "WF.HeaderScorerHist", HEADERS_SCORER_HIST); sc.Dictionary = "WF.scorer"; sc.AddHighlightRule(m_score.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); } }
public override void LoadScore(BaseScore baseScore, ScoreCenter center) { m_center = center; RssScore score = baseScore as RssScore; if (score == null) { throw new NullReferenceException("Not a RSS score!"); } tbxScoreId.Text = score.Id; tbxScore.Text = score.Name; tbxUrl.Text = score.Url; tbxEncoding.Text = score.Encoding; }
public void AddResults(List <BaseScore> scores, int round, string icon, string fullname, int index) { // Round Results GenericScore sc = CreateNewScore(m_score.Id, "round", "Results", icon, "0", index); sc.Url = String.Format("{0}spielplan/{1}-spieltag/{2}/ergebnisse/", WF_URL, fullname, VariableUrl.PARAM); sc.Range = new VariableUrl(round, 1, m_score.Rounds, LocalizationManager.GetString(Labels.RoundLabel)); sc.SetCanLive(true); sc.SetLive(m_score.IsLive()); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.LeagueRoundResults", SIZES_LEAGUE_ROUND_RESULTS); sc.Dictionary = "WF.last"; sc.AddRule(1, Operation.IsNotNull, "", RuleAction.FormatCell, "Header"); sc.AddHighlightRule(m_score.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); }
public static void RegisterScore(string gameName, string gameVariation, float score, ScoreCenter.SortDirection direction, EventHandler<ScoreCenter.RegisterScoreCompletedEventArgs> completedEvent) { ScoreCenter.ScoreServiceSoapClient client = new ScoreCenter.ScoreServiceSoapClient(); client.RegisterScoreAsync(FingerGames.Instance.GameManager.AnonymousId, Settings.Instance.GamerTag, gameName, gameVariation, 0, 0, score, direction, GenerateHash(FingerGames.Instance.GameManager.AnonymousId, Settings.Instance.GamerTag, gameName, gameVariation, score)); client.RegisterScoreCompleted += delegate(object sender, ScoreCenter.RegisterScoreCompletedEventArgs e) { if (e.Error != null) { completedEvent(sender, null); } else { completedEvent(sender, e); } }; }
void OnTriggerExit2D(Collider2D col) { if (!col.gameObject.CompareTag("Note")) { return; } MyNote mynote = col.gameObject.GetComponent <MyNote>(); remove_mynote(mynote); if (!mynote.m_is_hit) { ScoreCenter.instance().clear_combo_hit_count(); // on_hit_note(mynote); } }
public void AddAssistsScore(List <BaseScore> scores, string fullname, int index) { // Assists if (this.HasDetail(ScoreCenter.GetParameter(m_parameters, "WF.KeyAssists", KEY_ASSISTS))) { GenericScore sc = CreateNewScore(m_score.Id, "assists", "Assists", IMG_ASSIST, "0", index++); sc.Url = String.Format("{0}assists/{1}/", WF_URL, fullname); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.TopScorers", SIZES_SCORER); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(m_parameters, "WF.HeaderAssist", HEADERS_ASSIST); sc.Dictionary = "WF.scorer"; sc.AddRule(-1, Operation.EqualTo, "1", RuleAction.FormatLine, "Level1"); sc.AddHighlightRule(m_score.Highlights, 4, RuleAction.FormatLine); scores.Add(sc); } }
private void SetRules(GenericScore score, ScoreCenter center) { grdRule.Rows.Clear(); if (score.Rules == null) { return; } foreach (Rule rule in score.Rules) { Style st = center.FindStyle(rule.Format); grdRule.Rows.Add(rule.Column.ToString(), rule.Operator.ToString(), rule.Value, rule.Action.ToString(), st == null ? String.Empty : rule.Format); } }
/// <summary> /// Defines a League. /// </summary> /// <param name="wfscore">The Worldfootball definition.</param> /// <param name="parameters"></param> /// <returns></returns> private static List <BaseScore> DefineLeague(WorldFootballScore wfscore, ScoreParameter[] parameters) { int index = 0; List <BaseScore> scores = new List <BaseScore>(); string fullname = wfscore.FullLeagueName + "-" + wfscore.Season; ScoreDetails details = GetScoreDetails(wfscore, parameters); int round = details.Round; // add results details.AddResults(scores, round, IMG_RESULTS, fullname, index++); // Standings string element = "0"; string nbLeague = wfscore.Details.Split(',').FirstOrDefault(x => x.Contains(";")); if (!String.IsNullOrEmpty(nbLeague)) { element = nbLeague; } GenericScore sc = CreateNewScore(wfscore.Id, "table", "Standings", IMG_STANDINGS, element, index++); sc.BetweenElts = BetweenElements.RepeatHeader; sc.Url = String.Format("{0}spielplan/{1}-spieltag/{2}/tabelle/", WF_URL, fullname, round); sc.Skip = 1; sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.LeagueStandings", SIZES_STANDINGS); sc.Dictionary = "WF.table"; sc.Headers = ScoreCenter.GetParameter(parameters, "WF.HeaderStandings", HEADERS_STANDINGS); sc.AddLevelsRule(wfscore.Levels); sc.AddHighlightRule(wfscore.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); details.AddTopScorerScore(scores, fullname, index++); details.AddAssistsScore(scores, fullname, index++); details.AddStadiumScore(scores, fullname, index++); details.AddRefereeScore(scores, fullname, index++); details.AddHistoryScore(scores, index++); details.AddTopScorerHistScore(scores, index++); return(scores); }
// int score = 0; void on_hit_note(MyNote mynote) { remove_mynote(mynote); // Debug.Log( "on_hit_note : " + (score++) ); // animation // add score ScoreCenter.instance().add_score(1); m_score_ui.set_score(ScoreCenter.instance().Score); ScoreCenter.instance().add_combo_hit_count(1); m_combo_hit_ui.set_score(ScoreCenter.instance().ComboHitCount); // destroy gameobject Destroy(mynote.gameObject); mynote.m_note.m_gameobject = null; m_sprite_index = 0; // if( null != m_animator ) // { // m_animator.SetInteger( "action_state", MyConst.ACTION_STATE_HIT ); // } }
public static IList <BaseScore> GetRealScores(FussballdeScore score, ScoreParameter[] parameters) { List <BaseScore> scores = new List <BaseScore>(); GenericScore sc = null; int index = 0; var details = score.Details.Split(',').ToList(); sc = GenericScore.CreateNewScore(score.Id, C_KEY_RESULTS, "Results", XPATH_RESULTS, IMG_RESULTS, "", index++); sc.Url = GetUrl(score.Url, C_KEY_RESULTS); SetRound(sc); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesResults", SIZES_RESULTS); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderResults", HEADER_RESULTS); sc.AddRule(3, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddRule(5, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddRule(1, Operation.Contains, "vorheriger Spieltag", RuleAction.SkipLine, ""); sc.AddRule(1, Operation.Contains, "Verlegte Spiele", RuleAction.MergeCells, ""); sc.AddHighlightRule(score.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); sc = GenericScore.CreateNewScore(score.Id, C_KEY_TABELLE, "Standings", XPATH_TABELLE, IMG_TABELLE, "", index++); sc.Url = GetUrl(score.Url, C_KEY_TABELLE); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesTabelle", SIZES_TABELLE); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderTabelle", HEADER_TABELLE); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddLevelsRule(score.Levels); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); if (details.Contains("runde")) { sc = GenericScore.CreateNewScore(score.Id, "hinrunde", "1st Round", XPATH_TABELLE, IMG_TABELLE_ROUND1, "0", index++); sc.Url = GetUrl(score.Url, C_KEY_RUNDE); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesTabelle", SIZES_TABELLE); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderTabelle", HEADER_TABELLE); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); sc = GenericScore.CreateNewScore(score.Id, "rueckrunde", "2nd Round", XPATH_TABELLE, IMG_TABELLE_ROUND2, "1", index++); sc.Url = GetUrl(score.Url, C_KEY_RUNDE); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesTabelle", SIZES_TABELLE); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderTabelle", HEADER_TABELLE); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); } sc = GenericScore.CreateNewScore(score.Id, "heim", "Home", XPATH_TABELLE, IMG_TABELLE_HOME, "0", index++); sc.Url = GetUrl(score.Url, C_KEY_HEIMAUS); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesTabelle", SIZES_TABELLE); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderTabelle", HEADER_TABELLE); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); sc = GenericScore.CreateNewScore(score.Id, "auswaerts", "Away", XPATH_TABELLE, IMG_TABELLE_AWAY, "1", index++); sc.Url = GetUrl(score.Url, C_KEY_HEIMAUS); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesTabelle", SIZES_TABELLE); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderTabelle", HEADER_TABELLE); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); if (details.Contains("fairness")) { sc = GenericScore.CreateNewScore(score.Id, C_KEY_FAIRNESS, "Fair Play", XPATH_FAIRPLAY, IMG_REFEREE, "", index++); sc.Url = GetUrl(score.Url, C_KEY_FAIRNESS); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesFairplay", SIZES_FAIRPLAY); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderFairplay", HEADER_FAIRPLAY); sc.AddRule(2, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 2, RuleAction.FormatLine); scores.Add(sc); } if (details.Contains("torjaeger")) { sc = GenericScore.CreateNewScore(score.Id, C_KEY_SCORER, "Top Scorers", XPATH_SCORER, IMG_TOPSCORER, "", index++); sc.Url = GetUrl(score.Url, C_KEY_SCORER); sc.Skip = 1; sc.Dictionary = "Fussballde"; sc.Sizes = ScoreCenter.GetParameter(parameters, "Fde.SizesScorer", SIZES_SCORER); sc.Headers = ScoreCenter.GetParameter(parameters, "Fde.HeaderScorer", HEADER_SCORER); sc.AddRule(3, Operation.Contains, CUT_BEFORE, RuleAction.CutBefore, ""); sc.AddHighlightRule(score.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); } return(scores); }
void Start() { scoree = GameObject.FindObjectOfType<ScoreCenter>(); timer = maxTimer; rgbd = GetComponent<Rigidbody2D> (); //lastPos = transform.position; startPos = transform.position; desiredScale = transform.localScale; line = GameObject.FindGameObjectWithTag ("Line"); }
public virtual void LoadScore(BaseScore baseScore, ScoreCenter center) { throw new NotImplementedException(); }
/// <summary> /// Defines a Qualification Tournament. /// </summary> /// <param name="wfscore">The Worldfootball definition.</param> /// <param name="parameters"></param> /// <returns></returns> private static List <BaseScore> DefineQualification(WorldFootballScore wfscore, ScoreParameter[] parameters) { int index = 0; List <BaseScore> scores = new List <BaseScore>(); GenericScore sc = null; string fullname = wfscore.FullLeagueName; if (String.IsNullOrEmpty(wfscore.Season) == false) { fullname += "-" + wfscore.Season; } // add results scores sc = CreateNewScore(wfscore.Id, "results", "Results", IMG_RESULTS, "2", index++); string competition = ScoreCenter.GetParameter(parameters, "WF.Competition", KEY_COMPETITION); sc.Url = String.Format("{0}{2}/{1}/", WF_URL, wfscore.FullLeagueName, competition); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.Results", SIZES_RESULTS); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.LiveConfig = LiveConfig.Copy(wfscore.LiveConfig, ScoreCenter.GetParameter(parameters, "WF.LiveFormat", "{2} {5} {4}")); sc.SetCanLive(true); sc.Element = "0"; scores.Add(sc); // retrieve details: first element is the list of groups List <string> items = wfscore.Details.Split(',').ToList(); char[] groups = items[0].ToCharArray(); foreach (char g in groups) { // add group results sc = CreateNewScore(wfscore.Id, "gr" + g, String.Format("Group {0}", Char.ToUpper(g)), "", "0", index++); sc.Url = String.Format("{0}spielplan/{1}-gruppe-{2}/0/", WF_URL, fullname, g); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.GroupResults", SIZES_GROUP_RESULTS); sc.Image = String.Format(@"Groups\Group{0}", Char.ToUpper(g)); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.AddHighlightRule(wfscore.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); // add group standings sc = CreateNewScore(wfscore.Id, "resgr" + g, "Standings", "", "1", index++); sc.Url = String.Format("{0}spielplan/{1}-gruppe-{2}/0/", WF_URL, fullname, g); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(parameters, "WF.HeaderStandings", HEADERS_STANDINGS); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.GroupStandings", SIZES_GROUP_STANDINGS); sc.Image = String.Format(@"Groups\Table{0}", Char.ToUpper(g)); sc.AddHighlightRule(wfscore.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); } // add rounds foreach (string round in items) { if (round == items[0]) { continue; } if (round == "stadium" || round == "referee") { continue; } sc = CreateNewScore(wfscore.Id, round, round, IMG_RESULTS, "0", index++); sc.Url = String.Format("{0}spielplan/{1}-{2}/0/", WF_URL, fullname, round); sc.Sizes = wfscore.TwoLegs && round != "finale" ? ScoreCenter.GetParameter(parameters, "WF.QualificationLevel2", SIZES_QUALIFICATION_LEVEL2) : ScoreCenter.GetParameter(parameters, "WF.QualificationLevel1", SIZES_QUALIFICATION_LEVEL1); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.AddRule(0, Operation.Contains, "{Rückspiel},", RuleAction.ReplaceText, ""); scores.Add(sc); } // add details ScoreDetails details = GetScoreDetails(wfscore, parameters); details.AddTopScorerScore(scores, fullname, index++); details.AddAssistsScore(scores, fullname, index++); details.AddStadiumScore(scores, fullname, index++); details.AddRefereeScore(scores, fullname, index++); details.AddHistoryScore(scores, index++); details.AddTopScorerHistScore(scores, index++); return(scores); }
private void ScoresReady(object sender, ScoreCenter.RegisterScoreCompletedEventArgs e) { _isScoreLoading = false; if (null != e) { foreach (ScoreCenter.ScoreItem item in e.Result) { float scale = (item.IsLast) ? 1.0f : .8f; int height = (item.IsLast) ? 45 : 35; Color foreColor = (item.IsLast) ? Color.LightBlue : Color.White; XnaButton nameLabel = new XnaButton(new Rectangle(0, 0, 300, height)); nameLabel.FontZoom = scale; nameLabel.Color = foreColor; nameLabel.Text = item.User; nameLabel.Font = _menuFont; nameLabel.HorizontalAlignment = HorizontalAlignment.Left; _nameScorePanel.AddChild(nameLabel); XnaButton scoreLabel = new XnaButton(new Rectangle(0, 0, 250, height)); scoreLabel.FontZoom = scale; scoreLabel.Color = foreColor; scoreLabel.Text = string.Format("{0:0000.0}", item.Score); scoreLabel.Font = _menuFont; scoreLabel.HorizontalAlignment = HorizontalAlignment.Center; _scoreScorePanel.AddChild(scoreLabel); XnaButton totalLabel = new XnaButton(new Rectangle(0, 0, 250, height)); totalLabel.FontZoom = scale; totalLabel.Color = foreColor; totalLabel.Text = string.Format("#{0}", item.Index); totalLabel.Font = _menuFont; totalLabel.HorizontalAlignment = HorizontalAlignment.Center; _totalScorePanel.AddChild(totalLabel); } } }
public override void LoadScore(BaseScore baseScore, ScoreCenter center) { m_center = center; UpdateStyleList(); GenericScore score = baseScore as GenericScore; if (score == null) { throw new NullReferenceException("Not a generic score!"); } errorProvider1.Clear(); // always clear tbxScore.Clear(); tbxUrl.Clear(); tbxXpath.Clear(); tbxXPathRow.Clear(); tbxXPathCol.Clear(); tbxEncoding.Clear(); tbxHeaders.Clear(); tbxSizes.Clear(); tbxSkip.Clear(); tbxMaxLines.Clear(); tbxElement.Clear(); ckxUseTheader.Checked = false; ckxUseCaption.Checked = false; ckxImgAlt.Checked = false; ckxNewLine.Checked = false; ckxAllowWrapping.Checked = false; ckxLive.Checked = false; tbxLiveFormat.Clear(); tbxLiveFilter.Clear(); tbxDictionary.Clear(); grdRule.Rows.Clear(); grdRule.Enabled = false; // score EnableControls(); tbxLiveFormat.Enabled = false; tbxLiveFilter.Enabled = false; ParsingOptions options = score.GetParseOption(); tbxScore.Text = score.Name; tbxUrl.Text = score.Url; tbxXpath.Text = score.XPath; tbxXPathRow.Text = score.XPathRow; tbxXPathCol.Text = score.XPathCol; tbxEncoding.Text = score.Encoding; tbxHeaders.Text = score.Headers; tbxSizes.Text = score.Sizes; tbxSkip.Text = score.Skip.ToString(); tbxMaxLines.Text = score.MaxLines.ToString(); tbxElement.Text = score.Element; tbxDictionary.Text = score.Dictionary; if (score.LiveConfig != null) { ckxLive.Checked = score.LiveConfig.enabled; tbxLiveFormat.Text = score.LiveConfig.Value; tbxLiveFilter.Text = score.LiveConfig.filter; } ckxUseTheader.Checked = Tools.CheckParsingOption(options, ParsingOptions.UseTheader); ckxUseCaption.Checked = Tools.CheckParsingOption(options, ParsingOptions.Caption); ckxNewLine.Checked = Tools.CheckParsingOption(options, ParsingOptions.NewLine); ckxAllowWrapping.Checked = Tools.CheckParsingOption(options, ParsingOptions.WordWrap); ckxReverseOrder.Checked = Tools.CheckParsingOption(options, ParsingOptions.Reverse); ckxImgAlt.Checked = Tools.CheckParsingOption(options, ParsingOptions.ImgAlt); cbxBetweenElements.SelectedValue = score.BetweenElts; tbxScoreId.Text = score.Id; grdRule.Enabled = true; SetRules(score, center); }
public override void LoadScore(BaseScore baseScore, ScoreCenter center) { tbxScore.Text = baseScore.Name; tbxScoreId.Text = baseScore.Id; }