コード例 #1
0
        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);
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        /// <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.");
        }
コード例 #7
0
        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);
            }
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
 public bool Logout()
 {
     StoredDisciple = null;
     return(true);
 }
コード例 #12
0
 public ContextService()
 {
     currentGroup   = Extensions.ReadSettings <Group>("CurrentGroup");
     Candidates     = Extensions.ReadSettings <Disciple[]>("Candidates")?.ToList() ?? new List <Disciple>();
     storedDisciple = Extensions.ReadSettings <Disciple>("StoredDisciple");
 }
コード例 #13
0
 internal void SetCurrent(Disciple profile)
 {
     ProfileService.StoredDisciple = profile;
 }
コード例 #14
0
 /// <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;
 }
コード例 #15
0
 public ContextService()
 {
     DefaultGroupId = Extensions.ReadInt("DefaultGroupId");
     Candidates     = Extensions.ReadSettings <Disciple[]>("Candidates")?.ToList() ?? new List <Disciple>();
     storedDisciple = Extensions.ReadSettings <Disciple>("StoredDisciple");
 }