IEnumerable <TResult> JoinCore <TInner1, TInner2, TInner3, TInner4, TJoinKey, TResult>(IMemoryFinder <TJoinKey, TInner1> innerMemory1, IMemoryFinder <TJoinKey, TInner2> innerMemory2, IMemoryFinder <TJoinKey, TInner3> innerMemory3, IMemoryFinder <TJoinKey, TInner4> innerMemory4, Func <TOuter, TJoinKey> keySelector, Func6 <TOuter, TInner1, TInner2, TInner3, TInner4, TResult> resultSelector) { foreach (var outer in outerList) { var key = keySelector(outer); var inner1 = innerMemory1.FindOrDefault(key); var inner2 = innerMemory2.FindOrDefault(key); var inner3 = innerMemory3.FindOrDefault(key); var inner4 = innerMemory4.FindOrDefault(key); yield return(resultSelector(outer, inner1, inner2, inner3, inner4)); } }
public MasterMemoryQuery <TResult> Join <TInner1, TInner2, TInner3, TInner4, TJoinKey, TResult>(IMemoryFinder <TJoinKey, TInner1> innerMemory1, IMemoryFinder <TJoinKey, TInner2> innerMemory2, IMemoryFinder <TJoinKey, TInner3> innerMemory3, IMemoryFinder <TJoinKey, TInner4> innerMemory4, Func <TOuter, TJoinKey> keySelector, Func6 <TOuter, TInner1, TInner2, TInner3, TInner4, TResult> resultSelector) { return(new MasterMemoryQuery <TResult>(JoinCore(innerMemory1, innerMemory2, innerMemory3, innerMemory4, keySelector, resultSelector))); }
public virtual Func0 addFBNotificationListener(Func6 cb) { return(no_op); }
IEnumerable <TResult> FlatJoinCore <TInner1, TInner2, TInner3, TInner4, TJoinKey, TResult>(IMemoryFinder <TJoinKey, TInner1> innerMemory1, IMemoryFinder <TJoinKey, TInner2> innerMemory2, IMemoryFinder <TJoinKey, TInner3> innerMemory3, IMemoryFinder <TJoinKey, TInner4> innerMemory4, Func <TOuter, TJoinKey> keySelector, Func6 <TOuter, TInner1, TInner2, TInner3, TInner4, TResult> resultSelector, bool defaultIfEmpty) { foreach (var outer in outerList) { var key = keySelector(outer); var inner1Many = DefaultIfEmpty(innerMemory1.FindMany(key), defaultIfEmpty); var inner2Many = DefaultIfEmpty(innerMemory2.FindMany(key), defaultIfEmpty); var inner3Many = DefaultIfEmpty(innerMemory3.FindMany(key), defaultIfEmpty); var inner4Many = DefaultIfEmpty(innerMemory4.FindMany(key), defaultIfEmpty); foreach (var inner1 in inner1Many) { foreach (var inner2 in inner2Many) { foreach (var inner3 in inner3Many) { foreach (var inner4 in inner4Many) { yield return(resultSelector(outer, inner1, inner2, inner3, inner4)); } } } } } }
// The program part of the Main Menu // Directs players to other parts of the program public static void MenuProg() { string rawInput = "TBC"; char input = '0'; bool check = false; GameDraw(); // Checks if player input is valid while (!check) { Console.Write("\nYour Input: "); rawInput = Console.ReadLine(); try{ input = Convert.ToChar(rawInput); if (input >= 49 && input <= 56) { check = true; } else { GameDraw(); Console.WriteLine("\nError: '{0}' is not a valid input", rawInput); } } catch { if (rawInput == "") { check = true; } else { GameDraw(); Console.WriteLine("\nError: '{0}' is not a valid input", rawInput); } } } // Directs player to corresponding menu switch (input) { case '1': Func1.CovidAnnProg(Global.covidAnnPurch); break; case '2': Func2.HealthProg(); break; case '3': Func3.VaccineProg(); break; case '4': Func4.BorderProg(); break; case '5': Func5.DefenceProg(); break; case '6': Func6.EducationProg(); break; case '7': Intro(true); break; case '8': Help(); break; default: // Initiates all inputs and simulates Covid-19 Game.Submit(); break; } }