예제 #1
0
        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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        public HandlerContext(GameProfile prof, PlayerInfo info, bool hasKeyboard)
        {
            profile    = prof;
            PlayerInfo = info;

            Options            = prof.Options;
            bHasKeyboardPlayer = hasKeyboard;
        }
예제 #4
0
 public abstract bool Initialize(GameHandler handler, HandlerData handlerData, UserGameInfo game, GameProfile profile);