コード例 #1
0
        public void WhenIFillAccountSettingsFormWithData()
        {
            ProfileSettings     settings        = sharedStorage.GetSharedInfo <ProfileSettings>(ContextTag.SettingData);
            AccountSettingsPage accountSettings = new AccountSettingsPage(Driver, _appSettings, sharedStorage);

            accountSettings.FillSettingsForm(settings);
        }
コード例 #2
0
    static public void SetupScenarioFromJSON(string scenarioID, JSONObject json, ProfileSettings profileSettings)
    {
        if (!scenarioExists)
        {
            JSONObject scenario             = json[scenarioID];
            JSONObject settings_buildings   = scenario.GetField("building");
            JSONObject settings_player      = scenario.GetField("player");
            JSONObject settings_shopkeepers = scenario.GetField("shopkeeper");
            JSONObject settings_officers    = scenario.GetField("officer");

            List <string> existingBuildingResources = new List <string>();
            existingBuildingResources = GenerateBuildingResources(scenarioID, settings_buildings);

            List <string> occupiedBuildingResources = new List <string>();
            occupiedBuildingResources = GeneratePlayerResource(occupiedBuildingResources, scenarioID, settings_player, profileSettings);
            occupiedBuildingResources = GenerateShopkeeperResources(occupiedBuildingResources, scenarioID, settings_shopkeepers);
            occupiedBuildingResources = GenerateOfficerResources(occupiedBuildingResources, scenarioID, settings_officers);

            HarmonizeBuildingResourcesToDesignWorld(existingBuildingResources, occupiedBuildingResources);
            HarmonizePlayerResourcesToDesignWorld();
            HarmonizeOfficerResourcesToDesignWorld();
            scenarioExists = true;
        }
        else
        {
            Debug.LogError("You really shoulnd't be loading a new scenario when you've already got one there, buddy. Call 'ClearScenario()' first. -Scott");
        }
    }
コード例 #3
0
        public MainWindowViewModel()
        {
            // Read the settings file to get the available profiles
            List <Profile> profiles = ProfileSettings.getProfiles();

            _profilesView = new ProfilesViewModel(profiles);

            _comparisonView = new DbComparisonViewModel();
            _comparisonView.OnComparisonComplete += new EventHandler <DatabaseComparisonEventArgs>((sender, args) => {
                StatusText = "";
                foreach (TableComparison tableComp in args.Tables)
                {
                    if (tableComp.LeftTable != null && tableComp.RightTable == null && tableComp.LeftTable.CreateStatement != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.CreateStatement + _sqlStatementDivider;
                    }
                    else if (tableComp.LeftTable != null)
                    {
                        StatusText = StatusText + tableComp.LeftTable.ToString() + _sqlStatementDivider;
                    }
                }
            });

            CopySqlToClipboardCommand = new AppCommand((sender) => CopySqlToClipboard(sender), (sender) => CanCopySqlToClipboard(sender));
        }
コード例 #4
0
    public static void SetupScenarioFromJSON(string scenarioID, JSONObject json, ProfileSettings profileSettings)
    {
        if(!scenarioExists)
        {
            JSONObject scenario = json[scenarioID];
            JSONObject settings_buildings = scenario.GetField ("building");
            JSONObject settings_player = scenario.GetField ("player");
            JSONObject settings_shopkeepers = scenario.GetField ("shopkeeper");
            JSONObject settings_officers = scenario.GetField ("officer");

            List<string> existingBuildingResources = new List<string>();
            existingBuildingResources = GenerateBuildingResources (scenarioID, settings_buildings);

            List<string> occupiedBuildingResources = new List<string>();
            occupiedBuildingResources	= GeneratePlayerResource (occupiedBuildingResources, scenarioID, settings_player, profileSettings);
            occupiedBuildingResources	= GenerateShopkeeperResources (occupiedBuildingResources, scenarioID, settings_shopkeepers);
            occupiedBuildingResources	= GenerateOfficerResources (occupiedBuildingResources, scenarioID, settings_officers);

            HarmonizeBuildingResourcesToDesignWorld(existingBuildingResources, occupiedBuildingResources);
            HarmonizePlayerResourcesToDesignWorld();
            HarmonizeOfficerResourcesToDesignWorld();
            scenarioExists = true;
        } else {
            Debug.LogError ("You really shoulnd't be loading a new scenario when you've already got one there, buddy. Call 'ClearScenario()' first. -Scott");
        }
    }
コード例 #5
0
        public void GivenIGetPickupDataFromFile(string file)
        {
            string          data     = DataFiles.ReadJsonDataFile(file);
            ProfileSettings settings = ObjectSerializer.DeserializeToObject <ProfileSettings>(data);

            sharedStorage.SetSharedInfo(ContextTag.SettingData, settings);
        }
コード例 #6
0
        //
        // GET: /ProfileSettings/
        public ActionResult Settings(string message = null)
        {
            ViewBag.Message  = null;
            ViewBag.MsgColor = "red";
            var             loggedInUser = (User)Session["User"];
            ProfileSettings settingsUser = new ProfileSettings();

            settingsUser.Id        = loggedInUser.Id;
            settingsUser.FirstName = loggedInUser.FirstName;
            settingsUser.LastName  = loggedInUser.LastName;
            settingsUser.Username  = loggedInUser.Username;
            settingsUser.Email     = loggedInUser.Email;

            if (message != null)
            {
                if (message == "Current Password Incorrect")
                {
                    ViewBag.Message = "Current Password Incorrect";
                    return(View(settingsUser));
                }
                if (message == "Paswords do not macht")
                {
                    ViewBag.Message = "New Password and Confirm Password do not match";
                    return(View(settingsUser));
                }
                else
                {
                    ViewBag.MsgColor = "green";
                    ViewBag.Message  = "Change Confirmed";
                    return(View(settingsUser));
                }
            }
            return(View(settingsUser));
        }
コード例 #7
0
        private static void CancelChanges(object e)
        {
            if (CtrEnable == Boolean.TrueString)
            {
                CtrEnable       = Boolean.FalseString;
                BtnModifyEnable = Boolean.TrueString;

                //    PopulateIpEnvironment();

                SettingScreenLoaded_Load(e);
                //    PopulateIpEnvironment();
            }

            else
            {
                CtrEnable       = Boolean.FalseString;
                BtnModifyEnable = Boolean.TrueString;

                //  PopulateIpEnvironment();
                SettingScreenLoaded_Load(e);
                //  PopulateIpEnvironment();
            }
            ProfileSettings oBolt = System.Windows.Application.Current.Windows.OfType <ProfileSettings>().FirstOrDefault();

            if (oBolt != null)
            {
                oBolt.Close();
            }
        }
コード例 #8
0
        public string[] AskLoginAndPass(string pwTitle, string config)
        {
            // set labels
            lblAsk.Text  = pwTitle;
            lblName.Text = config;

            ProfileSettings settings = Settings.current.getProfile(config);

            chkRememberName.Checked = settings.storeUserName;
            txtUsername.Text        = settings.userName;
            // show form, return
            Console.WriteLine("Oups I did it again ;)");
            //if (this.ShowDialog() != DialogResult.OK)
            //    return null;
            //else
            //{
            settings.storeUserName = chkRememberName.Checked;
            if (settings.storeUserName)
            {
                settings.userName = txtUsername.Text;
            }
            Settings.current.Save();
            return(new string[] { txtUsername.Text, txtPasswd.Text });
            //}
        }
コード例 #9
0
        public Profil()
        {
            InitializeComponent();
            var kroki = new List <string>();
            int x     = 0;

            while (x <= 30000)
            {
                kroki.Add(x.ToString());
                x += 500;
            }
            CelKroki.ItemsSource = kroki;
            ProfileSettings settings = UtilityMethods.ReadSettings();

            for (int i = 0; i < kroki.Count; i++)
            {
                if (kroki[i] == settings.CelKroki)
                {
                    CelKroki.SelectedIndex = i;
                    settings.CelKrokiId    = i;
                    UtilityMethods.SaveFile(settings, App.FolderPath, "settings.json");
                    break;
                }
            }
            CheckPerm();
        }
コード例 #10
0
ファイル: CharacterProfile.cs プロジェクト: vanasisf/HBRelog
 public CharacterProfile()
 {
     Settings    = new ProfileSettings();
     Tasks       = new ObservableCollection <BMTask>();
     TaskManager = new TaskManager(this);
     ShoudPause  = false;
 }
コード例 #11
0
        //Karakter és játék adatok elmentése
        public void SaveProfile()
        {
            FileStream   stream = OpenFile(FileMode.Create);
            Profile_Data data   = playerProfile.GetData();

            try
            {
                formatter.Serialize(stream, data);
            }

            catch (SerializationException e)
            {
                Debug.Log(e);
                throw;
            }

            stream.Close();

            if (settingsState == ProfileSettings.NewProfile)
            {
                Notification_Controller.DisplayNotification("Az új profil létrehozva!");
            }

            else if (settingsState == ProfileSettings.Default)
            {
                Notification_Controller.DisplayNotification("A változtatások sikeresen elmentve!");
            }

            else if (settingsState == ProfileSettings.Silent)
            {
                settingsState = ProfileSettings.Default;
            }
        }
コード例 #12
0
        public ProfileSettings ReadProfiles(string devices)
        {
            // Validate
            ServerRuntime.TestAdminAccess();

            // Helper
            string defaultName;

            // Create response
            var settings =
                new ProfileSettings
            {
                SystemProfiles =
                    ServerRuntime
                    .VCRServer
                    .GetProfiles(ConfigurationProfile.Create, out defaultName)
                    .OrderBy(profile => profile.Name, ProfileManager.ProfileNameComparer)
                    .ToArray()
            };

            // Merge default
            settings.DefaultProfile = defaultName;

            // Report
            return(settings);
        }
コード例 #13
0
        public bool?WriteProfiles(string devices, [FromBody] ProfileSettings settings)
        {
            // Validate
            ServerRuntime.TestAdminAccess();

            // List of profiles to use
            var profiles = settings.SystemProfiles.Where(profile => profile.UsedForRecording).Select(profile => profile.Name).ToList();

            // Move default to the front
            var defaultIndex = profiles.IndexOf(settings.DefaultProfile);

            if (defaultIndex >= 0)
            {
                // Insert at the very beginning
                profiles.Insert(0, profiles[defaultIndex]);
                profiles.RemoveAt(defaultIndex + 1);
            }

            // Prepare
            var update = VCRConfiguration.Current.BeginUpdate(SettingNames.Profiles);

            // Fill
            update[SettingNames.Profiles].NewValue = string.Join("|", profiles);

            // Process
            return(ServerRuntime.Update(update.Values, ServerRuntime.VCRServer.UpdateProfiles(settings.SystemProfiles, profile => profile.Name, (profile, device) => profile.WriteBack(device))));
        }
コード例 #14
0
    public Resources_Player(ProfileSettings profile,
	                         Resources_Building home,
	                         int money,
	                         int income,
	                         int expenses,
	                         int strength,
	                         int presence,
	                         int opinion,
	                         Resources_Inventory inventory)
        : base(profile.id,
		        profile.name,
		        profile.image,
		        profile.gender,
		        home,
		        money,
		        income,
		        expenses,
		        strength,
		        inventory)
    {
        _presence = presence;
        _opinion = opinion;
        instance = this;

        Manager_Resources.NewPlayer(this);
    }
コード例 #15
0
    public Resources_Player(ProfileSettings profile,
                            Resources_Building home,
                            int money,
                            int income,
                            int expenses,
                            int strength,
                            int presence,
                            int opinion,
                            Resources_Inventory inventory)
        : base(profile.id,
               profile.name,
               profile.image,
               profile.gender,
               home,
               money,
               income,
               expenses,
               strength,
               inventory)
    {
        _presence = presence;
        _opinion  = opinion;
        instance  = this;

        Manager_Resources.NewPlayer(this);
    }
コード例 #16
0
        public void ThenVerifyAccountSettingsPageContainsCorrectData()
        {
            ProfileSettings     settings        = sharedStorage.GetSharedInfo <ProfileSettings>(resourceTag);
            AccountSettingsPage accountSettings = new AccountSettingsPage(Driver, _appSettings, sharedStorage);

            accountSettings.AssertSettingDetailsData(settings);
        }
コード例 #17
0
 void ChangeTheme(object sender, EventArgs e)
 {
     try
     {
         ProfileSettings settings = (ProfileSettings)BindingContext;
         UtilityMethods.SaveFile(settings, App.FolderPath, "settings.json");
         if (settings.UseSystemTheme)
         {
             Application.Current.UserAppTheme = OSAppTheme.Unspecified;
         }
         else
         {
             if (settings.DarkMode)
             {
                 Application.Current.UserAppTheme = OSAppTheme.Dark;
             }
             else
             {
                 Application.Current.UserAppTheme = OSAppTheme.Light;
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
コード例 #18
0
        private void Element_Unfocused(object sender, FocusEventArgs e)
        {
            ProfileSettings saveSettings = (ProfileSettings)BindingContext;

            saveSettings.CzasTreninguCel = TimeSpan.FromHours(Convert.ToDouble(CzasTreningu.Text));
            Console.WriteLine(saveSettings.ToString());
            UtilityMethods.SaveFile(saveSettings, App.FolderPath, "settings.json");
        }
コード例 #19
0
 private void LoadAllSettings()
 {
     laucherSettings      = new LauncherSettings();
     serverSettings       = new ServerSettings(System.IO.Path.Combine(laucherSettings.GetServerLocation(), "data"));
     ProfileSettings      = new ProfileSettings(Path.Combine(laucherSettings.GetServerLocation(), "data/profiles"));
     LoginBackendURL.Text = laucherSettings.GetBackendURL();
     Port.Text            = serverSettings.GetServerPort();
 }
コード例 #20
0
 public UserDataManager()
 {
     currentPlayData = new UserData(true);
     recordedData    = new HighScoreData();
     profileSettings = new ProfileSettings();
     CheckSaveDataDirectory();
     LoadData();
 }
コード例 #21
0
 public void EditAccount(ProfileSettings settings)
 {
     PasswordText.Password    = settings.WowSettings.Password;
     WoWFileInput.FileName    = settings.WowSettings.WowPath;
     HBProfileInput.FileName  = settings.HonorbuddySettings.HonorbuddyProfile;
     HBPathInput.FileName     = settings.HonorbuddySettings.HonorbuddyPath;
     RegionCombo.SelectedItem = settings.WowSettings.Region;
     IsEditing = true;
 }
コード例 #22
0
        public void ShouldChangeProfileSettings()
        {
            Profile         profile  = GetNewProfile();
            ProfileSettings settings = new ProfileSettings(PrivacyType.Public);

            profile.ChangeSettings(settings);

            Assert.IsNotNull(profile.Settings);
            Assert.AreEqual(PrivacyType.Public, profile.Settings.PrivacyType);
        }
コード例 #23
0
        private void BoltSetting_Closing(object e)
        {
            Windows_BoltSettingsLocationChanged(e);
            ProfileSettings oBolt = System.Windows.Application.Current.Windows.OfType <ProfileSettings>().FirstOrDefault();

            if (oBolt != null)
            {
                oBolt.Close();
            }
        }
コード例 #24
0
        /// <summary>
        /// Parametres d'un utilisateur
        /// </summary>
        /// <returns></returns>
        public string GetSetting(ProfileSettings profileSetting, string userName = null)
        {
            if (userName == null)
            {
                userName = Membership.GetUser()?.UserName;
            }

            var profile = ProfileBase.Create(userName);

            return(profile.GetPropertyValue(profileSetting.ToString()).ToString());
        }
コード例 #25
0
 public DataPagesViewModel(string fileName)
 {
     _fileName               = fileName;
     _profileSettings        = GpfTools.GpfUtil.ProfilesList().First(p => p.Item1.Contains(_fileName)).Item2.Items[0] as ProfileSettings;
     _selectedDataPagesItems = new ObservableCollection <ProfileSettingsNavDataPage>();
     foreach (var item in _profileSettings.NavDataPage)
     {
         _selectedDataPagesItems.Add(item);
     }
     _selectedDataPagesItems.CollectionChanged += SelectedDataPagesItemsCollectionChanged;
     AddCommand = new RelayCommand(g => _selectedDataPagesItems.Add(new ProfileSettingsNavDataPage()
     {
         DataPageCustomIdx = "0",
         DataPageField1    =
             new DataPageField1[]
         {
             new DataPageField1()
             {
                 DataPageField
                     = "83",
                 DataPageFieldLabel
                     = "0"
             }
         },
         DataPageField2 =
             new DataPageField2[]
         {
             new DataPageField2()
             {
                 DataPageField
                     = "83",
                 DataPageFieldLabel
                     = "0"
             }
         },
         DataPageField3 =
             new DataPageField3[]
         {
             new DataPageField3()
             {
                 DataPageField
                     = "83",
                 DataPageFieldLabel
                     = "0"
             }
         },
         DataPageIdx  = "0",
         DataPageName =
             "5",
         DataPageType =
             "3"
     }));
     DeleteCommand = new RelayCommand(g => _selectedDataPagesItems.Remove(SelectedDataPage));
 }
コード例 #26
0
        private void SetSettings(ProfileSettingsTypeEnum profileType, int profileIdValue)
        {
            List <IPolyline> profileLines = new List <IPolyline>();

            var profileSetting = profileSettings[profileType];

            if (profileSetting == null)
            {
                profileSetting = new ProfileSettings();
            }


            //Check if the View.DemLayerName if Layer name
            profileSetting.DemLayerName = View.DemLayerName;


            if (profileType == ProfileSettingsTypeEnum.Points)
            {
                var line = EsriTools.CreatePolylineFromPoints(pointsToShow[ProfileSettingsPointButtonEnum.PointsFist], pointsToShow[ProfileSettingsPointButtonEnum.PointsSecond]);
                if (line != null)
                {
                    profileLines.Add(line);
                }
            }

            if (View.SelectedProfileSettingsType == ProfileSettingsTypeEnum.Fun)
            {
                try
                {
                    var lines = EsriTools.CreatePolylinesFromPointAndAzimuths(pointsToShow[ProfileSettingsPointButtonEnum.CenterFun], View.FunLength, View.FunLinesCount, View.FunAzimuth1, View.FunAzimuth2);
                    if (lines != null)
                    {
                        profileLines.AddRange(lines);
                    }
                }
                catch (MilSpaceProfileLackOfParameterException ex)
                {
                    //TODO: Wtite log
                    MessageBox.Show(ex.Message, "MilSpace", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    //TODO: Wtite log
                }
            }

            profileSetting.ProfileLines = profileLines.ToArray();

            profileSettings[profileType] = profileSetting;

            InvokeOnProfileSettingsChanged();

            GraphicsLayerManager.UpdateCalculatingGraphic(profileSetting.ProfileLines, profileIdValue, (int)profileType);
        }
コード例 #27
0
    private void LoadScenario()
    {
        // TODO: Implement Player Profile Settings
        ProfileSettings profile = new ProfileSettings();

        profile.gender = Enums.Gender.female;
        profile.image  = "DefaultFace";
        profile.name   = "ProfileName";

        // Hard coded to load scenario_01;
        Scenario_Script.SetupScenarioFromJSON("scenario_01", _scenarioData, profile);
    }
コード例 #28
0
 private void EditAccount(ProfileSettings charSettings)
 {
     if (charSettings != null)
     {
         var ani = new DoubleAnimation(255, new Duration(TimeSpan.Parse("0:0:0.4")))
         {
             DecelerationRatio = 0.7
         };
         AccountConfigGrid.BeginAnimation(WidthProperty, ani);
         AccountConfig.EditAccount(charSettings);
     }
 }
コード例 #29
0
        public void LoadProfile()
        {
            string path = Path.Combine(Application.persistentDataPath, fileName);

            mainMenuController = GameObject.Find("Menu_Controller").GetComponent <Main_Menu_Controller>();

            //Ellenőrzi, hogy van-e már mentésünk
            if (File.Exists(path))
            {
                FileStream   stream = OpenFile(FileMode.Open);
                Profile_Data data   = null;
                try
                {
                    data = formatter.Deserialize(stream) as Profile_Data;
                }

                catch (SerializationException e)
                {
                    Debug.Log(e);
                    throw;
                }

                stream.Close();

                //Megnézzük, hogy a betöltött adatok érvényesek-e
                if (data != default(Profile_Data))
                {
                    //Amennyiben igen, úgy betöltjük őket a profilba
                    Deck active    = factory.GetDeckFromList(data.activeDeck);
                    Deck secondary = factory.GetDeckFromList(data.secondaryDeck);
                    playerProfile = new Player(data, active, secondary);

                    //Jelezzük, hogy megtörtént a belépés.
                    mainMenuController.PlayerLoginStatus(true);
                }

                else
                {
                    Notification_Controller.DisplayNotification("A betöltés sikertelen!");
                    settingsState = ProfileSettings.NewProfile;
                    AskForName();
                    NewProfile();
                }
            }

            //Ha nincs még mentés file
            else
            {
                Notification_Controller.DisplayNotification("A mentést tároló fájl nincs létrehozva!");
                settingsState = ProfileSettings.NewProfile;
                AskForName();
            }
        }
コード例 #30
0
    public static void CreateProfileSettingsHolder()
    {
        ProfileSettings profileSettingsHolder =
            ScriptableObject.CreateInstance <ProfileSettings>();

        AssetDatabase.CreateAsset(profileSettingsHolder,
                                  "Assets/Resources/ScriptableObjects/ProfileSettings.asset");
        AssetDatabase.SaveAssets();

        EditorUtility.FocusProjectWindow();
        Selection.activeObject = profileSettingsHolder;
    }
コード例 #31
0
        public IActionResult UpdateDetails([FromBody] ProfileSettings profile)
        {
            try
            {
                AppUser user = _appDbContext.Set <AppUser>().FirstOrDefault(u => u.Id == _clientData.Id);

                if (user != null)
                {
                    _appDbContext.Attach(user);

                    if (profile.FirstName != user.FirstName)
                    {
                        user.FirstName = profile.FirstName;
                    }
                    if (profile.LastName != user.LastName)
                    {
                        user.LastName = profile.LastName;
                    }

                    if (_clientData.UserType == (int)UserType.Candidate)
                    {
                        if (profile.AllowSendResume != null)
                        {
                            CandidateUser candidate = _appDbContext.Set <CandidateUser>().FirstOrDefault(u => u.Id == _clientData.ChildId);
                            _appDbContext.Attach(candidate);
                            candidate.AllowSendResume = (bool)profile.AllowSendResume;
                        }
                    }

                    else if (_clientData.UserType == (int)UserType.Recruiter)
                    {
                        if (profile.ReceiveNotifications != null)
                        {
                            RecruiterUser recruiter = _appDbContext.Set <RecruiterUser>().FirstOrDefault(u => u.Id == _clientData.ChildId);
                            _appDbContext.Attach(recruiter);
                            recruiter.ReceiveNotifications = (bool)profile.ReceiveNotifications;
                        }
                    }

                    _appDbContext.SaveChanges();

                    return(Ok());
                }

                return(BadRequest("There was a problem updating details"));
            }
            catch (Exception e)
            {
                _log.LogError(e, "Update Details failed");
                return(BadRequest(e));
            }
        }
コード例 #32
0
 public MarketService(
     ILogger <MarketService> logger,
     WebRequestService requestService,
     SteamUrlService steamUrlService,
     ProfileSettings profileSettings,
     LocalCacheService localCacheService)
 {
     _logger            = logger;
     _requestService    = requestService;
     _steamUrlService   = steamUrlService;
     _profileSettings   = profileSettings;
     _localCacheService = localCacheService;
 }
コード例 #33
0
ファイル: Asuna.cs プロジェクト: luizssn/LeagueSharp
        public ProfileSettings GetProfileSettings()
        {
            var baseName = "Asuna";

            ProfileSettings p = new ProfileSettings
            {
                ProfileName = baseName,
                ProfileDescription = "Asuna's profile. This profile contains the settings the developer of VHR uses in game.",
                IsDefault = true,
                Options = GetOptions()
            };
            return p;
        }
コード例 #34
0
ファイル: Eirik.cs プロジェクト: luizssn/LeagueSharp
        public ProfileSettings GetProfileSettings()
        {
            var baseName = "Eirik";

            ProfileSettings p = new ProfileSettings
            {
                ProfileName = baseName,
                ProfileDescription = "Eirik's Profile. A Diamond Vayne Main's settings.",
                IsDefault = true,
                Options = GetOptions()
            };
            return p;
        }
コード例 #35
0
    private void LoadScenario()
    {
        // TODO: Implement Player Profile Settings
        ProfileSettings profile = new ProfileSettings();
        profile.gender = Enums.Gender.female;
        profile.image = "DefaultFace";
        profile.name = "ProfileName";

        // Hard coded to load scenario_01;
        Scenario_Script.SetupScenarioFromJSON("scenario_01",_scenarioData, profile);
    }
コード例 #36
0
    protected static List<string> GeneratePlayerResource(List<string> occupiedBuildingResources, string scenarioID, JSONObject json, ProfileSettings profileSettings)
    {
        for (int i = 0; i < json.Count; i++)
        {
            JSONObject player = json[i];

            new Resources_Player(
                // profile settings, home, money, income, expenses, strength, presence, opinion, inventory
                profileSettings,
                Manager_Resources.GetBuildingByID(player.GetField ("home").str),
                Mathf.Clamp (int.Parse (player.GetField ("money").str), moneyMin, moneyMax),
                Mathf.Clamp (int.Parse (player.GetField ("income").str), moneyMin, moneyMax),
                Mathf.Clamp (int.Parse (player.GetField ("expenses").str), moneyMin, moneyMax),
                Mathf.Clamp (int.Parse (player.GetField ("strength").str), statMin, statMax),
                Mathf.Clamp (int.Parse (player.GetField ("presence").str), statMin, statMax),
                Mathf.Clamp (int.Parse (player.GetField ("opinion").str), statMin, statMax),
                Resources_Inventory.GetInventoryByID(player.GetField ("inventory").str)
            );

            if(occupiedBuildingResources.Contains(player.GetField("home").str)) {
                Debug.LogError ("Easy, Nelly. Someone messed up. Go tell whoever was messing with the static data that the player's safehouse can't be in " + player.GetField("home").str + ". Someone else is already in there! -Scott");
            } else {
                occupiedBuildingResources.Add (player.GetField("home").str);
            }
        }
        return occupiedBuildingResources;
    }
	public void Insert(int index, ProfileSettings authorizationSettings) {}
	// Methods
	public void Add(ProfileSettings profilesSettings) {}
コード例 #39
0
        public ProfileSettings ReadProfiles( string devices )
        {
            // Validate
            ServerRuntime.TestAdminAccess();

            // Helper
            string defaultName;

            // Create response
            var settings =
                new ProfileSettings
                {
                    SystemProfiles =
                        ServerRuntime
                            .VCRServer
                            .GetProfiles( ConfigurationProfile.Create, out defaultName )
                            .OrderBy( profile => profile.Name, ProfileManager.ProfileNameComparer )
                            .ToArray()
                };

            // Merge default
            settings.DefaultProfile = defaultName;

            // Report
            return settings;
        }
コード例 #40
0
ファイル: Settings.cs プロジェクト: genoher/Noodles
 public Settings()
 {
     ProfileSettings = new ProfileSettings();
     MembershipSettings = new MembershipSettings();
 }