Ejemplo n.º 1
0
 static public Model.Player.Types PlayerTypeToModel(PlayerViewModel vm)
 {
     if (vm.PlayerType == PlayerTypes.ptComputer)
     {
         return(Model.Player.Types.Computer);
     }
     else if (vm.PlayerType == PlayerTypes.ptHuman)
     {
         return(Model.Player.Types.Human);
     }
     else
     {
         throw new NotSupportedException();
     }
 }
Ejemplo n.º 2
0
        static public Model.Player.Levels PlayerLevelToModel(PlayerViewModel vm)
        {
            switch (vm.Level)
            {
            case PlayerLevels.plEasy:
                return(Model.Player.Levels.Easy);

            case PlayerLevels.plMedium:
                return(Model.Player.Levels.Medium);

            case PlayerLevels.plHard:
                return(Model.Player.Levels.Hard);

            default:
                throw new NotSupportedException();
            }
        }