public static GameProfile CleanClone(GameProfile profile) { GameProfile nprof = new GameProfile(); nprof.playerData = new List <PlayerInfo>(); nprof.screens = profile.screens.ToList(); List <PlayerInfo> source = profile.playerData; for (int i = 0; i < source.Count; i++) { PlayerInfo player = source[i]; if (player.ScreenIndex != -1) { // only add valid players to the clean version nprof.playerData.Add(player); } } Dictionary <string, object> noptions = new Dictionary <string, object>(); foreach (var opt in profile.Options) { noptions.Add(opt.Key, opt.Value); } nprof.options = noptions; return(nprof); }
/// <summary> /// Clones this Game Info into a new Generic Context /// </summary> /// <returns></returns> public virtual HandlerContext CreateContext(GameProfile profile, PlayerInfo info, bool hasKeyboardPlayer) { HandlerContext context = new HandlerContext(profile, info, hasKeyboardPlayer); ObjectUtil.DeepCopy(this, context); return(context); }
public HandlerContext(GameProfile prof, PlayerInfo info, bool hasKeyboard) { profile = prof; PlayerInfo = info; Options = prof.Options; bHasKeyboardPlayer = hasKeyboard; }
public abstract bool Initialize(GameHandler handler, HandlerData handlerData, UserGameInfo game, GameProfile profile);