public void GetSayingTest( ) { for (int i = 0; i < 1000; i++) { Console.WriteLine(GameSaying.GetSaying( )); } }
public void SortSayingTest( ) { GameSaying.LoadSayings( ); GameSaying.Sayings.Sort((x, y) => { int contentLenthDiff = x.ContentLenth - y.ContentLenth; if (contentLenthDiff == 0) { int lenthDiff = x.ToXElement( ).ToString( ).Length - y.ToXElement( ).ToString( ).Length; if (lenthDiff == 0) { return(string.CompareOrdinal(x.Content, y.Content)); } return(lenthDiff); } return(contentLenthDiff); }); string lastSaying = string.Empty; foreach (GameSaying saying in GameSaying.Sayings) { if (saying.Content != lastSaying) { Console.WriteLine(saying.ToXElement( )); lastSaying = saying.Content; } } }
private TimeSpan UpdateSaying( ) { CurrentSaying = GameSaying.GetSaying( ); SayingPresenter newPresenter = HidePrsenster; HidePrsenster = CurrentPrenster; HidePrsenster.Hide( ); CurrentPrenster = newPresenter; CurrentPrenster.Saying = CurrentSaying; CurrentPrenster.Show( ); TimeSpan timeSpan = TimeSpan.FromSeconds(CurrentSaying.Content.Length * 0.1 + 2); return(timeSpan); }
public void LoadSayingTest( ) { GameSaying.LoadSayings( ); }