public void Initialize() { CustomLocalizationManager.ImportCSV("Disciple.csv", ';'); clanRef = Clan.Make(); RegisterSubtypes(); MakeStatuses(); MakeEnhancers(); MakeCards(); foreach (var bundle in BundleManager.LoadedAssetBundles) { Trainworks.Trainworks.Log(BepInEx.Logging.LogLevel.All, bundle.Value.GetAllAssetNames().Join()); } SecondDisciple.Make(); Disciple.Make(); Clan.RegisterBanner(); MakeArtifacts(); ProviderManager.SaveManager.GetMetagameSave().SetLevelAndXP(clanRef.GetID(), 10, 99999); //PrintCardStats(); //foreach (SubtypeData s in SubtypeManager.AllData) //{ // Trainworks.Trainworks.Log(BepInEx.Logging.LogLevel.All, "Subtype: " + s.LocalizedName + " - Key: " + s.Key); //} //ProviderManager.SaveManager.EnableTestScenario(ProviderManager.SaveManager.GetAllGameData().FindScenarioDataByName("Level4BattleJunk"), true); }
async Task ExecuteConfirmCommand() { if (IsBusy) { return; } IsBusy = true; try { var me = new Disciple { FormalName = FormalName, PreferName = PreferName, PersonalStatement = PersonalStatement, }; await ProfileService.LoginAsync(me); } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public async Task <IActionResult> Edit(int id, [Bind("Id")] Disciple disciple) { if (id != disciple.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(disciple); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DiscipleExists(disciple.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(disciple)); }
async Task ExecuteCreateCommand() { if (IsBusy) { return; } IsBusy = true; try { var me = new Disciple { FormalName = Name, PreferName = NickName, }; await ProfileService.LoginAsync(me, true); } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public async Task <bool> LoginAsync(Disciple disciple, bool createNew) { if (disciple == null) { disciple = StoredDisciple; } if (disciple == null) { return(false); } if (StoredDisciple != null && !createNew) { disciple.Id = StoredDisciple.Id; } if (await dataService.SignUpAsync(disciple)) { StoredDisciple = disciple; Logined = true; return(true); } Logined = false; return(false); }
/// <summary> /// Executing the test. /// </summary> public static void ExecuteTest() { SpiritualMaster spiritMaster = new SpiritualMaster("Krsna Swami"); Disciple spiritualDisciple = new Disciple("Krsna Das"); spiritMaster.SetCommand(new OrderCommand(spiritualDisciple)); spiritMaster.GiveOrder("Chant 300,000 rounds."); }
public async Task <bool> AssignAsync(Group group, Disciple disciple, string title) { try { await DiscipleEndPoint.PatchItemAsync(group.Id, "Assign", new Assign { DiscipleId = disciple.Id, Title = title }); return(true); } catch (Exception ex) { Debug.WriteLine(ex.Message); return(false); } }
public async Task <IActionResult> Create([Bind("Id")] Disciple disciple) { if (ModelState.IsValid) { _context.Add(disciple); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(disciple)); }
public async Task <bool> SignUpAsync(Disciple disciple) { var ret = await DiscipleEndPoint.AddItemAsync(disciple, "signup"); Token = ret.Token; DiscipleEndPoint.SetToken(Token); ParticipateEndPoint.SetToken(Token); GroupEndPoint.SetToken(Token); AlbumEndPoint.SetToken(Token); PostEndPoint.SetToken(Token); return(true); }
public async Task <bool> SaveChangesAsync(Disciple disciple, bool createNew) { if (disciple == null) { return(false); } if (StoredDisciple != null && !createNew) { disciple.Id = StoredDisciple.Id; } if (disciple.Id == 0) { StoredDisciple = await DiscipleDirectory.AddItemAsync(disciple); } else { await DiscipleDirectory.UpdateItemAsync(disciple); StoredDisciple = disciple; } return(true); }
public bool Logout() { StoredDisciple = null; return(true); }
public ContextService() { currentGroup = Extensions.ReadSettings <Group>("CurrentGroup"); Candidates = Extensions.ReadSettings <Disciple[]>("Candidates")?.ToList() ?? new List <Disciple>(); storedDisciple = Extensions.ReadSettings <Disciple>("StoredDisciple"); }
internal void SetCurrent(Disciple profile) { ProfileService.StoredDisciple = profile; }
/// <summary> /// Initializes a new instance of the <see cref="OrderCommand"/> class. /// </summary> /// <param name="disciple">The disciple to execute the command.</param> public OrderCommand(Disciple disciple) { this.commandedDisciple = disciple; }
public ContextService() { DefaultGroupId = Extensions.ReadInt("DefaultGroupId"); Candidates = Extensions.ReadSettings <Disciple[]>("Candidates")?.ToList() ?? new List <Disciple>(); storedDisciple = Extensions.ReadSettings <Disciple>("StoredDisciple"); }