Exemple #1
0
        private void BuildManagePlayerPermissionsResponses()
        {
            Model model = GetDialogCustomData <Model>();
            List <PCTerritoryFlagsPermission> playerPermissions = _structure.GetPermissionsByPlayerID(model.ActivePermissionsPlayerID, model.FlagID);
            List <TerritoryFlagPermission>    permissions       = _structure.GetAllTerritorySelectablePermissions();

            ClearPageResponses("ManagePlayerPermissionPage");

            foreach (TerritoryFlagPermission perm in permissions)
            {
                bool hasPermission = DoesPlayerPermissionsContainPermission(playerPermissions, perm);

                if (hasPermission)
                {
                    AddResponseToPage("ManagePlayerPermissionPage", "Remove Permission: " + perm.Name, true, new Tuple <string, dynamic>(string.Empty, perm.TerritoryFlagPermissionID));
                }
                else
                {
                    AddResponseToPage("ManagePlayerPermissionPage", "Add Permission: " + perm.Name, true, new Tuple <string, dynamic>(string.Empty, perm.TerritoryFlagPermissionID));
                }
            }

            AddResponseToPage("ManagePlayerPermissionPage", "Back");
        }