/// <summary> /// Gets the user account. /// </summary> /// <param name="userName">Name of the user.</param> /// <returns>An account container.</returns> public AccountContainer GetUserAccountContainer(string userName) { var account = new AccountContainer { IsEmpty = true, Profile = null, Roles = null, User = null }; var container = this.FindUser(userName); if (container.IsEmpty) { return(account); } account.User = container.User; try { account.Profile = UserProfile.GetUserProfile(userName); account.Roles = Roles.Providers[container.Providers.Role].GetRolesForUser(userName); account.StateAssignments = this.stateAssignmentRepository.SearchFor(x => x.UserName.Equals(userName)).ToList(); account.IsEmpty = false; } catch (Exception e) { account.IsEmpty = true; var logInfo = new LogInformation { ClassName = "AccountManager", MethodName = "GetUserAccountContainer", ArgumentsPassedIn = new string[] { userName }, ErrorMessage = e.Message }; this.logger.Error(JsonConvert.SerializeObject(logInfo)); } return(account); }
// Use this for initialization void Start() { Debug.Log(main); main = true; Application.targetFrameRate = 60; PenghargaanContainer.load(); PenghargaanController.load(); AudioController.Load(); acc = AccountContainer.load().accounts; if (!AudioController.getInstance().containKey("MainMenu")) { AudioSource audio = AudioController.getInstance().registerSound("Audio/Intro insyaAllah fix", "MainMenu"); DontDestroyOnLoad(audio); audio.loop = true; audio.Play(); } else { AudioSource audio = AudioController.getInstance().getAudioSource("MainMenu"); audio.UnPause(); } restartOption(); SaveGameUI.SetActive(false); Scene.moveOut(); }
public void load() { try { AccountContainer acc = AccountContainer.self; acc.loadGame(acc.accounts[savesDropdown.value]); Debug.Log(acc.currentAccount.name); namePlayers.text = "HAI " + AccountContainer.self.currentAccount.name + " !"; } catch (System.Exception e) { } }
public void newSaveGame() { try { AccountContainer acc = AccountContainer.self; acc.addNewSaveGame(inputNewSave.text); acc.loadGame(inputNewSave.text); restartOption(); } catch (System.Exception e) { } }
// Use this for initialization void Start() { Application.targetFrameRate = 60; PenghargaanContainer.load(); PenghargaanController.load(); AudioController.Load(); acc = AccountContainer.load().accounts; AudioSource audio = AudioController.getInstance().registerSound("Audio/Intro insyaAllah fix", "MainMenu"); audio.loop = true; audio.Play(); restartOption(); saveClose(); }
public void deleteSaveGame() { try { AccountContainer acc = AccountContainer.self; acc.deleteAccount(acc.accounts[savesDropdown.value].name); savesDropdown.value = 0; acc.currentAccount = null; restartOption(); } catch (System.Exception e) { } }
public static PenghargaanController load() { if (self == null) { self = new PenghargaanController(); self.AC = AccountContainer.load(); self.PC = PenghargaanContainer.load(); return(self); } else { return(self); } }
void layoutPenghargaan() { PenghargaanContainer pc = PenghargaanContainer.self; AccountContainer ac = AccountContainer.self; int index = 0; foreach (Penghargaan p in pc.penghargaans) { Transform a = Instantiate(penghargaanPrefab.transform, penghargaanContentContainer.transform); a.localPosition += new Vector3((index % 4) * dx, (index / 4) * dy * -1, 0); //a.localPosition = new Vector3(oriX + (index % 5) * dx, oriY + (index / 5) * dy, 0); a.gameObject.name = p.name; a.gameObject.SetActive(true); index++; if (ac.currentAccount.getPenghargaan(p)) { a.GetComponent <Image>().sprite = Resources.Load <Sprite>("Penghargaan/Gambar/" + p.imageName); } } }
public static IServiceCollection AddCosmosDbServices(this IServiceCollection services, IConfiguration configuration) { var connectionString = configuration.GetValue <string>("ConnectionStrings:CosmosDb"); var DatabaseName = configuration.GetValue <string>("CosmosDb:Database"); var accountContainerName = configuration.GetValue <string>("CosmosDb:AccountContainerName"); services.AddSingleton(_ => { var cosmosClient = new CosmosClient(connectionString); return(cosmosClient); }); services.AddScoped(p => { var cosmosClient = p.GetService <CosmosClient>(); var accountContainer = new AccountContainer(cosmosClient.GetContainer(DatabaseName, accountContainerName)); return(accountContainer); }); return(services); }
protected override void instantiate <T>() { base.instantiate <KarapanGameControl>(); base.name = Name; userInputControl = gameObject.GetComponent <UserInputControl>(); playerControl = GameObject.Find("Player").GetComponent <KarapanPlayerControl>(); lifeControl = gameObject.GetComponent <KarapanLifeControl>(); speedControl = gameObject.GetComponent <KarapanSpeedControl>(); progressControl = gameObject.GetComponent <ProgressControl>(); playerControl = GameObject.Find("Player").GetComponent <KarapanPlayerControl>(); addSubController("LifeControl", lifeControl); addSubController("SpeedControl", speedControl); addSubController("PlayerControl", playerControl); addSubController("ProgressControl", progressControl); addSubController("UserInputControl", userInputControl); UnityEngine.Debug.Log(userInputControl); userInputControl.addKeyMap(new KeyMap(new KeyCode[] { KeyCode.Space }, "TogglePause", delegate() { togglePause(); }, Input.GetKeyDown, 0.75F)); userInputControl.addKeyMap(new KeyMap(new KeyCode[] { KeyCode.Slash }, "DEBUG", delegate() { toggleDebug(); }, Input.GetKeyDown, UserInputControl.SeldomtimePress)); userInputControl.addKeyMap(new KeyMap(new KeyCode[] { KeyCode.Equals }, "reset", delegate() { gameOver(); resetGame(); }, Input.GetKeyDown, UserInputControl.SometimePress)); AccountContainer.load(); }
public static AccountContainer load() { if (self == null) { checkDirectory(); string path; path = "file://" + Application.dataPath + "/SaveGame/SaveGame.xml"; WWW file = new WWW(path); if (!file.text.Equals("")) { while (!file.isDone) { ; } XmlSerializer serializer = new XmlSerializer(typeof(AccountContainer)); StringReader s = new StringReader(file.text); self = serializer.Deserialize(s) as AccountContainer; foreach (Account a in self.accounts) { a.updateNewGameSave(MinigameContainer.loadMinigame().minigames); a.updateNewPenghargaanSave(PenghargaanContainer.load().penghargaans); self.Save(); } return(self); } else { AccountContainer a = new AccountContainer(); a.Save(); return(a); } } else { return(self); } }
public ForumController(ForumContainer forumcontainer, PostContainer postcontainer, AccountContainer accountcontainer) { this.forumContainer = forumcontainer; this.postContainer = postcontainer; this.accountContainer = accountcontainer; }
public AccountController(AccountContainer container) { this.accountContainer = container; }
void Start() { acc = AccountContainer.self; loadGame(); }
public LoginController(AccountContainer container, ILoggerFactory logger) { _logger = logger.CreateLogger("MyCategory"); this.accountContainer = container; }
public AccountRepository(AccountContainer accountContainer, IConfiguration configuration) : base(accountContainer, configuration) { _accountContainer = accountContainer; _configuration = configuration; }
public MessageController(AccountContainer aContainer, MessageContainer mContainer) { this.accountContainer = aContainer; this.messageContainer = mContainer; }
public static string SongInfoToString(string pattern, SongInfo songInfo, bool enableAutoShorten, AccountContainer acccon) { var tweet = SongInfoToString(pattern, songInfo); if (enableAutoShorten && acccon.CountText(tweet) > acccon.MaxTweetLength) { while (!(acccon.MaxTweetLength - acccon.CountText(tweet) >= 3)) { tweet = tweet.Remove(tweet.Length - 1); } tweet += "..."; } return(tweet); }
/// <summary> /// Populates the user add model with account container. /// </summary> /// <param name="model">The model.</param> /// <param name="container">The container.</param> public static void PopulateUserAddModelWithAccountContainer(UserAddModel model, AccountContainer container) { // update user information model.UserName = container.User.UserName; // update profile information MapProfileToUserAddModel(container.Profile, model); // update roles model.RoleSelections.ForEach(x => x.IsChecked = container.Roles.Contains(x.RoleName)); // update state assignments var selectedStates = container.StateAssignments.Select(x => x.StateId); model.CheckboxStateSelections.ForEach(x => x.IsChecked = selectedStates.Contains(x.StateId)); }