void OnEnable() { story = (Story)target; if (story.Forest == null) { story.Forest = new Forest(); } }
internal StoryInfo(Story story_id, int pic, int pic1, int pic2) { this.story_id = story_id; this.pic = pic; this.pic1 = pic2; this.pic2 = pic2; }
public StoryController() { defaultStory = new Story() { Id = 1, Name = "Holly Hope Aspinall", StoryTitle = "An Unexpected Journey", Events = new List<Event>() { new Event { Id=1, Title="Sticks The Landing", Description="Holly was born today at 20:04 weighing in at 8lb 13oz", DateTime=new DateTime(2015,06,12,20,04,00), ImgUrl="Content/Images/dribbbleburger_1x.png", }, new Event { Id=2, Title="Welcome To The World", Description="Holly is welcomed into the world by her grandparents", DateTime=new DateTime(2015,06,12,22,00,00), ImgUrl="Content/Images/Optionis.jpg", }, }, }; }
public void GetUserByCorrectGuid() { _story = new Story("Get Memebers By IMembershipApi"); _story.AsA("User") .IWant("to be able to get members, and give the correct users' GUID") .SoThat("I can do somethings for members"); IDictionary<Guid, UserObject> _Users = new Dictionary<Guid, UserObject>(); _story.WithScenario("Get members by ImembershipApi with the correct userName") .Given("More than one correct GUID of users", () => { _Uobject = _utils.CreateUserObject("Eunge Liu", true); _membershipApi.Save(_Uobject, "123Hello", "123Hello"); createdObjectIds.Add(_Uobject.UserId); }) .When("I use the Get, I can get users ", () => _Uobject2 = _membershipApi.Get(_Uobject.UserId)) .Then("The User2 is User1", () => { _Uobject.ShouldEqual(_Uobject2); }); this.CleanUp(); }
public void Process(Story story) { foreach (var scenario in story.Scenarios) { Dispose(scenario); } }
public void Verify() { _story = this.BDDfy(); Assert.That(_story.Metadata, Is.Not.Null); Assert.That(_story.Metadata.Title, Is.EqualTo(StoryTitle)); Assert.That(_story.Metadata.TitlePrefix, Is.EqualTo(StoryTitlePrefix)); }
public void verify_receive_appropriate_error_message_when_user_provides_a_bad_user_name_or_password() { AuthenticationStatus authStatus = null; Story authenticateUserStory = new Story("Authenticate User"); authenticateUserStory.AsA("Unauthenticated user") .IWant("supply my user name and password to the login form") .SoThat("I can authenticate to the application"); authenticateUserStory .WithScenario("User provides an invalid user name") .Given("My user name and password are ", "Big Daddy", "Gobldegook", delegate(string userName, string password) { UserRepositoryFactory factory = _mock.DynamicMock<UserRepositoryFactory>(); using (_mock.Record()) { Expect.Call(factory.Create(userName, password)) .Return(_mock.DynamicMock<IUserRepository>()); } _user = factory.Create(userName, password); }) .When("I authenticate the user", delegate {_service = _mock.DynamicMock<IAuthenticationService>(); using (_mock.Record()) { Expect.Call(_service.Authenticate(_user)) .Return(new AuthenticationStatus(new Exception("Bad Username or Password"))); } authStatus = _service.Authenticate(_user);}) .Then("I should receive an Authentication status of", Status.Failed, delegate(Status expectedStatus) {Assert.AreEqual(expectedStatus, authStatus.Status);}); }
public void ChangeUserPasswordObeyPasswordRule() { _story = new Story("Change Memebers' password By IMembershipApi"); _story.AsA("User") .IWant("to be able to change the password") .SoThat("I can use new password to login"); _story.WithScenario("Change the password with a correct GUID") .Given("Create a new User with old password, but the new password doesn't follow the password rule", () => { _Uobject = _utils.CreateUserObject("Eunge Liu", true); _oldpassword = "******"; _newpassword = "******"; _membershipApi.Save(_Uobject, _oldpassword, "123Hello"); createdObjectIds.Add(_Uobject.UserId); }) .When("I change the password ", () => { }) .Then("I can get Error Message from ChangePassword method", () => { typeof(ValidationException).ShouldBeThrownBy(() => _membershipApi.ChangePassword(_Uobject.UserId, _oldpassword, _newpassword)); }); this.CleanUp(); }
public void Process(Story story) { foreach (var scenario in story.Scenarios) { var executor = new ScenarioExecutor(scenario); executor.InitializeScenario(); if (scenario.Example != null) { var unusedValue = scenario.Example.Values.FirstOrDefault(v => !v.ValueHasBeenUsed); if (unusedValue != null) throw new UnusedExampleException(unusedValue); } var stepFailed = false; foreach (var executionStep in scenario.Steps) { if (stepFailed && ShouldExecuteStepWhenPreviousStepFailed(executionStep)) break; if (executor.ExecuteStep(executionStep) == Result.Passed) continue; if (!executionStep.Asserts) break; stepFailed = true; } } }
public Battle() { if (story == null) { this.story = App.Story; this.hero = story.Hero; currentStatus = null; } InitializeComponent(); buttons = new Dictionary<Type, Button>() { {typeof (Rock), RockButton}, {typeof (Paper), PaperButton}, {typeof (Scissors), ScissorsButton}, }; foreach (var button in buttons.Values) { button.Visibility = Visibility.Collapsed; } returnToNavi.Visibility = Visibility.Collapsed; RunBattle(); }
public void BulkGetUsersWithWrongGUID() { _story = new Story("Get Memebers By IMembershipApi"); _story.AsA("User") .IWant("to be able to get members, and give wrong users' GUID") .SoThat("I can get nothing"); IDictionary<Guid, UserObject> _Users = new Dictionary<Guid, UserObject>(); Guid _temp = new Guid(); _story.WithScenario("Get members by ImembershipApi with the only one correct Ids") .Given("only one correct GUID of user and fake one", () => { createdObjectIds.Add(_temp); }) .When("I use the BulkGet, I can get users ", () => _Users = _membershipApi.BulkGet(createdObjectIds)) .Then("The return a bunch of Users only contain null User ", () => { _Users[_temp].ShouldBeNull(); }); //createdObjectIds.Remove(_temp); this.CleanUp(); }
public void Verify() { _story = this.BDDfy(); _story.Metadata.ShouldNotBe(null); _story.Metadata.Title.ShouldBe(StoryTitle); _story.Metadata.TitlePrefix.ShouldBe(StoryTitlePrefix); }
public RequirementsDocument TranslatePivotalToSolr(Story pivotalstory) { //return null; return new RequirementsDocument() { ID = IDGenerator.GetUniqueIDForDocument(pivotalstory.Id.ToString(), _project.SystemType.ToDescription()), Title = HttpUtility.HtmlEncode(pivotalstory.Name), Status = pivotalstory.Current_State, Project = _project.ProjectName, Department = _project.Department, SystemSource = _project.SystemType.ToDescription(), LastIndexed = DateTime.Now, Description = HttpUtility.HtmlEncode(pivotalstory.Description), //AcceptanceCriteria = "Accepted At " + pivotalstory.AcceptedAt, StoryPoints = pivotalstory.Estimate.ToString(), ReleaseIteration = "tbd", ReferenceID = "tbd", StoryType = pivotalstory.Story_Type, Team = pivotalstory.Owned_By, //LastUpdated = pivotalstory.UpdatedAt, StoryURI = pivotalstory.Url, StoryTags = pivotalstory.Labels, IterationStart = GetIterationDurationForStory(pivotalstory.Id,pivotalstory.Project_Id), IterationEnd = GetIterationDurationForStory(pivotalstory.Id,pivotalstory.Project_Id) }; }
public bool CopyAttributes(Story pivotalstorySource, WorkItem destinationWorkItem) { destinationWorkItem.Fields[ConchangoTeamsystemScrumEstimatedeffort].Value = pivotalstorySource.Estimate; destinationWorkItem.Fields[ConchangoTeamsystemScrumBusinesspriority].Value = pivotalstorySource.Priority; destinationWorkItem.Fields[ConchangoTeamsystemScrumDeliveryorder].Value = pivotalstorySource.Priority; return true; }
public Story Create(string storyName, string creatorId, IEnumerable<string> genreNames) { var existingGenres = this.genreRepository.All() .Where(x => genreNames.Contains(x.Name)) .ToList(); foreach (var genre in genreNames) { if (!existingGenres.AsQueryable().Select(x => x.Name).Contains(genre)) { var newGenre = new Genre { Name = genre }; existingGenres.Add(newGenre); this.genreRepository.Add(newGenre); } } this.genreRepository.Save(); var story = new Story { AuthorId = creatorId, Name = storyName, Genres = existingGenres }; this.storyRepository.Add(story); this.storyRepository.Save(); return this.storyRepository.All() .FirstOrDefault(x => x.Name == story.Name); }
public void MemberLoginWithCorrectUserNameAndPwd() { _story = new Story("Login with UserName and Password"); _story.AsA("User") .IWant("to be able to login ") .SoThat("I can use features"); _story.WithScenario("login with a correct username and password") .Given("Create a new with old password", () => { _Uobject = _utils.CreateUserObject("Eunge Liu",true); _oldpassword = "******"; _newpassword = "******"; _membershipApi.Save(_Uobject, _oldpassword, "123Hello"); createdObjectIds.Add(_Uobject.UserId); }) .When("I login", () => { _ret = _membershipApi.Login(_Uobject.UserName, _oldpassword); }) .Then("The User can get Successful Logon", () => { _ret.ShouldEqual(LoginResults.Successful); }); this.CleanUp(); }
public void Process(Story story) { // use this report only for tic tac toe stories if (story.Metadata == null || !story.Metadata.Type.Name.Contains("TicTacToe")) return; var scenario = story.Scenarios.First(); var scenarioReport = new StringBuilder(); scenarioReport.AppendLine(string.Format(" SCENARIO: {0} ", scenario.Title)); if (scenario.Result != Result.Passed && scenario.Steps.Any(s => s.Exception != null)) { scenarioReport.Append(string.Format(" {0} : ", scenario.Result)); scenarioReport.AppendLine(scenario.Steps.First(s => s.Result == scenario.Result).Exception.Message); } scenarioReport.AppendLine(); foreach (var step in scenario.Steps) scenarioReport.AppendLine(string.Format(" [{1}] {0}", step.Title, step.Result)); scenarioReport.AppendLine("--------------------------------------------------------------------------------"); scenarioReport.AppendLine(); File.AppendAllText(Path, scenarioReport.ToString()); }
public StoryViewModel(Story story) { Story = story; StartVM = new LocationScenarioViewModel(Story.StartingScenario, Story.StartingLocation, "Start"); EndVM = new LocationScenarioViewModel(Story.EndingScenario, Story.EndingLocation, "End"); }
public override void SetUp() { sprint = new Sprint(); story = new Story(new Project(), new Gebruiker(), null, StoryType.UserStory); base.SetUp(); }
public RecordStruct(Story story_id, zword release, string serial) { this.story_id = story_id; this.release = release; this.serial = serial; }
void ISerializationCallbackReceiver.OnAfterDeserialize() { if (_storyJSON && !string.IsNullOrEmpty(_serializedData)) { _inkStory = new Story(_storyJSON.text); _inkStory.state.LoadJson(_serializedData); } }
public StoryContentPageViewModel(Story story, int index, int height, int width) { _story = story; _index = index; _width = width; _height = height; }
public void verify_receive_appropriate_success_message_when_user_provides_a_good_user_name_and_password() { Story authenticateUserStory = new Story("Authenticate User"); authenticateUserStory.AsA("USer with a valid user name and password") .IWant("supply my user name and password to the login form") .SoThat("I can authenticate to the application"); authenticateUserStory .WithScenario("User provides a valid user name and password") .Given("My user name and password are ", "mmann", "validpassword_1", delegate(string userName, string password) { UserRepositoryFactory factory = _mock.DynamicMock<UserRepositoryFactory>(); using (_mock.Record()) { Expect.Call(factory.Create(userName, password)) .Return(_mock.DynamicMock<IUserRepository>()); } _user = factory.Create(userName, password); }) .When("I authenticate the user", delegate {_service = _mock.DynamicMock<IAuthenticationService>(); using (_mock.Record()) { Expect.Call(_service.Authenticate(_user)) .Return(new AuthenticationStatus()); } _authStatus = _service.Authenticate(_user);}) .Then("I should receive an Authentication status of", Status.Success, delegate(Status expectedStatus) {Assert.AreEqual(expectedStatus, _authStatus.Status);}); }
public static Story Story(Project project, StoryPoint storyPoints, int hoursPerStoryPoint, Prioriteit moscowPrio, Gebruiker aangemaaktDoor) { Story story = new Story(project, aangemaaktDoor, Impact.Normaal, StoryType.UserStory); story.StoryPoints = storyPoints; story.Schatting = new TimeSpan(story.WaardeStoryPoints*hoursPerStoryPoint); story.ProductBacklogPrioriteit = moscowPrio; return story; }
public static Story Story(Project project, StoryPoint storyPoints, int hoursPerStoryPoint, Priority moscowPrio, User aangemaaktDoor) { Story story = new Story(project, aangemaaktDoor, Impact.Normal, StoryType.UserStory); story.StoryPoints = storyPoints; story.Estimation = new TimeSpan(story.StoryPointsValue*hoursPerStoryPoint); story.ProductBacklogPriority = moscowPrio; return story; }
void Awake() { if (instance != null && instance != this) { Destroy (gameObject); } instance = this; DontDestroyOnLoad (gameObject); }
public override void ResolveReferences (Story context) { base.ResolveReferences (context); if (VariableAssignment.IsReservedKeyword (constantName)) { Error ("cannot use '" + constantName + "' as a constant since it's a reserved ink keyword"); return; } }
protected void getTitle(Guid storyID) { //make a new story object Story stry = new Story(); //get the right story by the storyID passed in stry = stry.GetById(storyID); //set the text property of lblStoryTitle to the title property of stry lblStoryTitle.Text = stry.Title; }
public CommandLinePlayer (Story story, bool autoPlay = false, Parsed.Story parsedStory = null, bool keepOpenAfterStoryFinish = false) { this.story = story; this.autoPlay = autoPlay; this.parsedStory = parsedStory; this.keepOpenAfterStoryFinish = keepOpenAfterStoryFinish; _debugSourceRanges = new List<DebugSourceRange> (); }
public void CreateAssets() { if (sandboxProject == null) { sandboxProject = SandboxProject; andre = Instance.Get.MemberByID("Member:1000"); danny = Instance.Get.MemberByID("Member:1005"); epic1 = Instance.Create.Epic("Epic 1", SandboxProject); epic2 = epic1.GenerateChildEpic(); epic2.Name = "Epic 2"; epic2.Save(); story1 = SandboxProject.CreateStory("Story 1"); story2 = SandboxProject.CreateStory("Story 2"); story3 = SandboxProject.CreateStory("Story 3"); defect1 = SandboxProject.CreateDefect("Defect 1"); defect2 = SandboxProject.CreateDefect("Defect 2"); defect3 = SandboxProject.CreateDefect("Defect 3"); story1.Description = "ABCDEFGHIJKJMNOPQRSTUVWXYZ"; story1.Save(); story2.Description = "1234567890"; story2.Save(); story3.Description = "123 ABC"; story3.Save(); story1.Owners.Add(andre); story1.Owners.Add(danny); story3.Owners.Add(andre); defect2.Owners.Add(andre); defect3.Owners.Add(danny); defect1.FoundInBuild = "1.0.0.0"; defect1.ResolvedInBuild = "1.0.0.2"; defect1.Environment = "Windows"; defect1.Estimate = 2.0; defect1.Reference = "123456"; defect1.Save(); defect2.AffectedByDefects.Add(defect1); defect2.FoundInBuild = "1.0.0.0"; defect2.FoundBy = "Joe"; defect2.VerifiedBy = andre; defect2.Environment = "Mac"; defect2.Type.CurrentValue = "Documentation"; defect2.ResolutionReason.CurrentValue = "Duplicate"; defect2.Estimate = 1.0; defect2.Save(); defect3.FoundInBuild = "1.0.0.1"; defect3.FoundBy = "Bob"; defect3.VerifiedBy = danny; defect3.Type.CurrentValue = "Code"; defect3.ResolutionReason.CurrentValue = "Fixed"; defect3.Save(); } }
//private ArrayList SplitGiorniODT(string s) //{ // string[] Lines = s.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.None); // string tempGiorno = ""; // string l; // ArrayList SplitG = new ArrayList(); // foreach (string CurLine in Lines) // { // l = CurLine.Trim(); // if (èInizioGiornoSettimana(l) || èInizioDomenica(l)) // { // if (tempGiorno.Length > 0) // { // SplitG.Add(tempGiorno); // } // NumGiorni++; // tempGiorno = l + Environment.NewLine; // } // else tempGiorno += l + Environment.NewLine; // } // SplitG.Add(tempGiorno); // NumGiorni++; // return SplitG; //} private string PutTagOnDay(Story s) { //MessageBox.Show("linee:" + Convert.ToString(Lines.GetLength(0))); try { string l; foreach (StoryLine CurLine in s.Lines) { lineNum++; l = CurLine.getText().Trim(); switch (sec) { //sezione GIORNO case (int)Section.giorno: { switch (prog) { //inizio case 0: { //riga vuota salto if (l.Length == 0) { break; } //GIORNO da lun a sab if (èInizioGiornoSettimana(l)) { addInizioGiornoSettimana(new Story(CurLine)); } //GIORNO domenica else if (èInizioDomenica(l)) { addInizioDomenica(new Story(CurLine)); } else { addProblem("manca giorno"); } sTemp = new Story(); break; } //GIORNO case 1: { //riga vuota salto if (l.Length == 0) { break; } //aggiungo santi --> tutti sulla stessa riga addOutPQ("#02", new Story(CurLine)); prog = 2; sTemp = new Story(); break; } //NOME SANTI case 2: { //riga vuota salto if (l.Length == 0) { break; } if (èInizioLettura(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.primaLettura); break; } //controllo se la stringa è lunga --> allora è la storia dei santi if (l.Length > 90 && (!ODTorIDML || CheckFontSize(new Story(CurLine), "#03"))) { //l = AggiungiTagNomeSanti(l, dicPQTag[giornoCorrente]["#02"]); addOutPQ("#03", new Story(CurLine)); prog = 3; } else { if (èGiornataMondiale(new Story(CurLine))) { addGiornataMondiale(new Story(CurLine)); } else { //suppongo sia festività addOutPQ("#04", new Story(CurLine)); prog = 4; } } break; } //VITA SANTI case 3: { //riga vuota salto if (l.Length == 0) { break; } if (èInizioLettura(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.primaLettura); break; } if (èGiornataMondiale(new Story(CurLine))) { addGiornataMondiale(new Story(CurLine)); } else { //suppongo sia festività addOutPQ("#04", new Story(CurLine)); prog = 4; } break; } // FESTA RELIGIOSA IMPORTANTE case 4: { //riga vuota salto if (l.Length == 0) { break; } if (èInizioLettura(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.primaLettura); break; } if (èGiornataMondiale(new Story(CurLine))) { addGiornataMondiale(new Story(CurLine)); } else { addProblem("parte non riconosciuta"); } break; } // GIORNATA MONDIALE case 5: { //riga vuota salto if (l.Length == 0) { break; } if (èInizioLettura(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.primaLettura); break; } //suppongo sia testo altra festa addOutPQ("#06", new Story(CurLine)); //vado comunque avanti prog = 6; break; } // TESTO ALTRA FESTA case 6: { //riga vuota salto if (l.Length == 0) { break; } if (èInizioLettura(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.primaLettura); break; } //se arrivo qui è un problema ... non ho trovato la prma lettura addProblem("manca prima lettura"); sec = Section.primaLettura; prog = 1; break; } default: { addProblem("default .. non gestito!"); break; } } break; } //PRIMA O seconda LETTURA o vangelo case Section.vangelo: case Section.primaLettura: case Section.secondalettura: case Section.vangeloOppure: case Section.primaLetturaOppure: case Section.secondaLetturaOppure: { switch (prog) { case -1: { // quando so che deve iniziare una lettura o vangelo ma non ho ancora trovato niente if (l.Length == 0 && sTemp.Length == 0) { break; } if (èInizioLettura(l) || èInizioVangelo(l)) { addInizioLetturaOVangelo(new Story(CurLine), sec); break; } else if (èAntifonaVangelo(l)) { addInizioLetturaOVangelo(new Story(CurLine), sec); break; } else { sTemp.Addstory(new Story(CurLine)); addProblem("manca titolo e rif lettura"); } break; } //riferimenti case 0: { //riga vuota salto if (l.Length == 0) { break; } // NO--> COSì DA ERRORE MANCANZA RIFERIMENTO AppendInizioLetturaOVangelo(new Story(CurLine), sec); //AddRiferimento(new Story(CurLine), sec); break; } //titolo e riferimenti case 1: { //riga vuota salto if (l.Length == 0) { break; } AddTestoLettura(new Story(CurLine)); break; } case 3: { //riga vuota salto if (l.Length == 0) { break; } AddCommentoLettura(new Story(CurLine)); break; } default: { addProblem("default .. non gestito!"); break; } } break; } //SALMO case Section.salmo: { switch (prog) { //titolo e riferimenti case 0: { //riga vuota salto if (l.Length == 0 && sTemp.Length == 0) { break; } if (l.Length == 0) { Add1AntifonaSalmo(sTemp); sTemp = new Story(); break; } if (èoppure(l)) { Add1OppureSalmo(new Story(CurLine)); } else { sTemp.Addstory(new Story(CurLine)); } break; } case 1: { if (l.Length == 0 && sTemp.Length == 0) { break; } if (l.Length == 0) { AddStrofaSalmo(sTemp, 6); sTemp = new Story(); break; } if (èoppure(l)) { Add1OppureSalmo(new Story(CurLine)); } else { sTemp.Addstory(new Story(CurLine)); } break; } case 2: { //riga vuota salto if (l.Length == 0 && sTemp.Length == 0) { break; } if (l.Length == 0) { Add2AntifonaSalmo(sTemp); sTemp = new Story(); break; } else { sTemp.Addstory(new Story(CurLine)); } break; } case 3: { if (l.Length == 0 && sTemp.Length == 0) { break; } if (l.Length == 0) { AddStrofaSalmo(sTemp, 6); sTemp = new Story(); break; } if (èoppure(l)) { Add2OppureSalmo(new Story(CurLine)); } else { sTemp.Addstory(new Story(CurLine)); } break; } case 4: { if (l.Length == 0) { break; } Add3AntifonaSalmo(new Story(CurLine)); break; } case 5: case 6: case 7: case 8: case 9: case 10: //'A' su rtf case 11: //'B' su rtf case 12: //'C' su rtf case 13: //'D' su rtf { if (l.Length == 0 && sTemp.Length == 0) { break; } if (èInizioLettura(l)) { if (sTemp.Length > 0) { AddStrofaSalmo(sTemp, prog + 1); sTemp = new Story(); } addInizioLetturaOVangelo(new Story(CurLine), Section.secondalettura); break; } if (èAntifonaVangelo(l)) { if (sTemp.Length > 0) { AddStrofaSalmo(sTemp, prog + 1); sTemp = new Story(); } AddInizioPrimaAntifonaVangelo(new Story(CurLine)); break; } if (l.Length == 0) { AddStrofaSalmo(sTemp, prog + 1); sTemp = new Story(); break; } else { sTemp.Addstory(new Story(CurLine)); } break; } default: { addProblem("default .. non gestito!"); break; } } break; } case Section.antifonaVangelo: { switch (prog) { case 0: { if (l.Length == 0) { break; } if (èAntifonaVangelo(l)) { addOutPQ("#41", sTemp); sTemp = new Story(); addOutPQ("#42", new Story(CurLine)); //sec = Section.vangelo; //prog = -1; prog = 2; } else { sTemp.Addstory(new Story(CurLine)); } break; } case 2: { if (l.Length == 0) { break; } if (èoppure(l)) { AddOppureAntifonaVangelo(new Story(CurLine)); } else if (èInizioVangelo(l)) { addInizioLetturaOVangelo(new Story(CurLine), Section.vangelo); } break; } case 3: { if (l.Length == 0) { break; } if (èAntifonaVangelo(l)) { AddInizioSecondaAntifonaVangelo(new Story(CurLine)); } else { addProblem("manca seconda antifona vangelo"); } break; } case 4: { if (l.Length == 0) { break; } if (èAntifonaVangelo(l)) { addOutPQ("#45", sTemp); sTemp = new Story(); addOutPQ("#46", new Story(CurLine)); sec = Section.vangelo; prog = -1; } else { sTemp.Addstory(new Story(CurLine)); } break; } default: { addProblem("default .. non gestito!"); break; } } break; } default: { addProblem("default .. non gestito!"); break; } } } //aggiungo commento al vangelo if (sTemp.Length > 0) { addOutPQ("#" + (int)sec + "4", sTemp); sTemp = new Story(); } } catch (System.Exception ex) { addProblem("eccezione: " + ex.Message); } return(outPQTag); }
public List <Task> GetTasksForStory(int projectId, Story story) { return(this.GetTasksForStory(projectId, story.Id)); }
void InitStory() { story = new Story(storyJSON); story.allowExternalFunctionFallbacks = true; }
public List <Story> ExtraerStories(List <Story> Stories, List <string> ModeloFile, ref Story Storyi, int inicio, int fin, ref float Elevation) { for (int i = fin; i >= inicio; i--) { var Temp = ModeloFile[i].Split(); string Story_name = Temp[3].Replace("\"", ""); string Story_Height = Temp[6]; Elevation += float.Parse(Story_Height); Storyi = new Story(Story_name, float.Parse(Story_Height)); Storyi.StoryElevation = Elevation; Stories.Add(Storyi); } return(Stories); }
/// <summary> /// 试炼之地 /// </summary> public void Trial() { string passedRoles = RuntimeData.Instance.TrialRoles; Collection <string> cannotSelectList = new Collection <string>(); cannotSelectList.Add("主角"); foreach (var r in passedRoles.Split(new char[] { '#' })) { cannotSelectList.Add(r); } uihost.towerSelectRole.confirmBack = () => { this.uihost.Dispatcher.BeginInvoke(() => { Battle battle = BattleManager.GetBattle("试炼之地_战斗"); uihost.battleFieldContainer.LoadTrail( battle, uihost.towerSelectRole.selectedFriends[0], (result) => { uihost.battleFieldContainer.field.battleCallback = null; //win if (result == 1) { Role role = RuntimeData.Instance.Team[uihost.towerSelectRole.selectedFriends[0]]; RuntimeData.Instance.TrialRoles += "#" + role.Key; RuntimeData.Instance.TrialRoles.Trim(new char[] { '#' }); RuntimeData.Instance.AddLog(role.Name + "通过试炼之地"); string storyName = "霹雳堂_" + role.Key; Story story = StoryManager.GetStory(storyName); if (story == null) { RuntimeData.Instance.gameEngine.CallScence( uihost.battleFieldContainer.field, new NextGameState() { Type = "story", Value = "霹雳堂_胜利" }); } else { RuntimeData.Instance.gameEngine.CallScence( uihost.battleFieldContainer.field, new NextGameState() { Type = "story", Value = storyName }); } } else //lose { RuntimeData.Instance.gameEngine.CallScence( uihost.battleFieldContainer.field, new NextGameState() { Type = "story", Value = "original_试炼之地.失败" }); } }); }); }; uihost.towerSelectRole.load(1, null, cannotSelectList); }
public static bool HasDocuments(this Story story) { return((story.Documents?.Count ?? 0) != 0); }
public static DateTime?EndDate(this Story story) { return(story.Until ?? story.When); }
private void AddOppureAntifonaVangelo(Story l) { addOutPQ("#43", l); prog = 3; }
private void Add2OppureSalmo(Story l) { addOutPQ("#24", l); prog = 4; }
private void Add1OppureSalmo(Story l) { addOutPQ("#22", l); prog = 2; }
private void Add1AntifonaSalmo(Story l) { addOutPQ("#21", l); prog = 1; }
private void AddInizioSecondaAntifonaVangelo(Story l) { addOutPQ("#44", l); sec = Section.antifonaVangelo; prog = 4; }
//private string AggiungiTagNomeSanti(string Vita, string santi) //{ // string[] NomiSanti = santi.Split(new char[] { ' ', '.', ';' }, StringSplitOptions.RemoveEmptyEntries); // int progSanti = 0; // for (int i = 0; i < NomiSanti.Length; i++) // { // if (NomiSanti[i].Length > 3) // { // if (Vita.IndexOf(NomiSanti[i]) >= 0) // { // progSanti++; // //al posto del nome del santo metto il tag // Vita = Vita.Replace(NomiSanti[i], "#07_" + progSanti.ToString()); // //aggingo il tag alla lista dei tag del giorno // addOutPQ("#07_" + progSanti.ToString(), NomiSanti[i]); // } // } // } // return Vita; //} private void AddInizioPrimaAntifonaVangelo(Story l) { addOutPQ("#40", l); sec = Section.antifonaVangelo; prog = 0; }
public static bool CheckStoryIsValid(string storyJSON, out Exception exception, out Story story) { try { story = new Story(storyJSON); } catch (Exception ex) { exception = ex; story = null; return(false); } exception = null; return(true); }
public static bool StoryContainsVariables(Story story) { return(story.variablesState.GetEnumerator().MoveNext()); }
private void Add2AntifonaSalmo(Story l) { addOutPQ("#23", l); prog = 3; }
private void Add3AntifonaSalmo(Story l) { addOutPQ("#25", l); prog = 5; }
void Start() { s = GameObject.Find("Nox").GetComponent <Story>(); }
private static void SetStatus(ref Story story, StoryStatus storyStatus) { story.Status = ComponentsContainer.Get <IStoryStatusesDataModel>().GetStatusText(storyStatus); }
internal override void CreateStory() { story = new Story("Title of Gossip Team", "Body of Gossip Team"); }
private void Scence(NextGameState next) { if (RuntimeData.Instance.IsCheated) { MessageBox.Show("系统检测到你正在作弊,将结束游戏"); uihost.gameOverPanel.Show(); return; } uihost.reset(); if (next == null) { uihost.mapUI.resetTeam(); uihost.mapUI.Load(RuntimeData.Instance.CurrentBigMap); return; } //GC.Collect(); currentStatus = next.Type; if (Configer.Instance.Debug) { App.GameStudio.GameState(next); } switch (next.Type) { case "rollrole": uihost.rollRolePanel.Show(); break; case "tutorial": Tutorial(); break; case "map": uihost.mapUI.resetTeam(); if (next.Value == null || next.Value.Equals(string.Empty)) { next.Value = RuntimeData.Instance.CurrentBigMap; } RuntimeData.Instance.Date = RuntimeData.Instance.Date.AddHours(1); //地图耗时 if (Tools.ProbabilityTest(0.1)) { RuntimeData.Instance.CheckCheat(); } RuntimeData.Instance.CheckTimeFlags(); LoadMap(next.Value); if (Configer.Instance.AutoSave) { RuntimeData.Instance.Save("自动存档"); } break; //case "battle": // uihost.battleFieldContainer.Load(next.Value); // break; //case "scenario": // uihost.scence.Load(next.Value); // break; case "battle": Story story = new Story() { Name = "battle_" + next.Value }; story.Actions.Add(new GameData.Action() { Type = "BATTLE", Value = next.Value }); StoryManager.PlayStory(story, lastScenceIsMap); break; case "story": StoryManager.PlayStory(next.Value, lastScenceIsMap); lastScenceIsMap = false; break; case "arena": Arena(); break; case "trial": Trial(); break; case "tower": Tower(true); break; case "nextTower": Tower(false); break; case "huashan": Huashan(true); break; case "nextHuashan": Huashan(false); break; case "OLBattleHost": //OLBattle(true, 1); break; case "nextOLBattleHost": //OLBattle(false, 1); break; case "OLBattleGuest": //OLBattle(true, 2); break; case "nextOLBattleGuest": //OLBattle(false, 2); break; case "restart": Restart(); break; case "nextZhoumu": NextZhoumu(); break; case "gameOver": uihost.gameOverPanel.Show(); break; case "gameFin": uihost.fin.Visibility = Visibility.Visible; break; case "shop": uihost.shopPanel.Show(ShopManager.GetShop(next.Value)); break; case "sellshop": uihost.shopPanel.Show(SellShopManager.GetSellShop(next.Value)); break; case "game": uihost.playSmallGame(next.Value); break; case "mainmenu": uihost.mainMenu.Visibility = Visibility.Visible; break; case "xiangzi": //储物箱 uihost.shopPanel.ShowXiangzi(); break; case "item": //获得一个物品 RuntimeData.Instance.Items.Add(ItemManager.GetItem(next.Value).Clone()); LoadMap(RuntimeData.Instance.CurrentBigMap); break; case "danmu": uihost.AddDanMu(next.Value); LoadMap(RuntimeData.Instance.CurrentBigMap); break; case "wudaodahui": if (RuntimeData.Instance.IsCheated) { MessageBox.Show("系统检测到你正在作弊,禁止进入武道大会"); LoadMap(RuntimeData.Instance.CurrentBigMap); return; } uihost.wudaodahuiPanel.Show(); break; case "dropallsaves": SaveLoadManager.Instance.CreateEmptySave(); return; default: MessageBox.Show("error scence type: " + next.Type); uihost.mapUI.resetTeam(); uihost.mapUI.Load(RuntimeData.Instance.CurrentBigMap); break; } }
public void WhenIRequestStoryEstimateInformation() { var stories = new Stories(loginContext.gameId, loginContext.gameCode, client, loginContext.cookie); story = stories.GetStoryEstimateInfo(); }
public Mailer(Story story) { this._story = story; this._context = new ApplicationDbContext(); }
private bool èGiornataMondiale(Story s) { string l = s.getText(); return((l.ToLower().IndexOf("giornata") >= 0 || l.ToLower().IndexOf("anniversario") >= 0) && l.Length < 130); }
// Start is called before the first frame update void Start() { var imageList = Resources.FindObjectsOfTypeAll <Image>(); var dots = FindObjectsOfType <Text>().Where(x => x.CompareTag("dots")); AlexThought = GameObject.FindGameObjectWithTag("TBAlex"); JesseThought = GameObject.FindGameObjectWithTag("TBJesse"); dots1 = dots.ElementAt(0); dots2 = dots.ElementAt(1); JesseThought.SetActive(false); AlexThought.SetActive(false); foreach (var VARIABLE in imageList) { if (VARIABLE.CompareTag("Background")) { background = VARIABLE; } else if (VARIABLE.CompareTag("Textbc")) { textBackground = VARIABLE; } else if (VARIABLE.CompareTag("Sprite")) { claireSprite = VARIABLE; } else if (VARIABLE.CompareTag("BtnAlex")) { alexSprite = VARIABLE; } else if (VARIABLE.CompareTag("BtnJesse")) { jesseSprite = VARIABLE; } } textBox = FindObjectsOfType <Text>().FirstOrDefault(x => x.CompareTag("StoryCanvas")); var pNum = PhotonNetwork.LocalPlayer.ActorNumber; player1 = Scene1Script.player1; player2 = Scene1Script.player2; replies.Add(player1, -2); replies.Add(player2, -2); mainStory = new Story(MainInkFile.text); char1story = new Story(FirstCharInkFile.text); char2story = new Story(SecondCharInkFile.text); mainStory = new Story(MainInkFile.text); char1story = new Story(FirstCharInkFile.text); char2story = new Story(SecondCharInkFile.text); setPronouns(); if (Scene1Script.recovery) { Scene1Script.recovery = false; mainStory.state.LoadJson( System.IO.File.ReadAllText(@"D:\tese\RecoveryFiles\G" + Scene1Script.TestGroup + "PT3Main.txt")); char1story.state.LoadJson( System.IO.File.ReadAllText(@"D:\tese\RecoveryFiles\G" + Scene1Script.TestGroup + "PT3c1.txt")); char2story.state.LoadJson( System.IO.File.ReadAllText(@"D:\tese\RecoveryFiles\G" + Scene1Script.TestGroup + "PT3c2.txt")); tBox = System.IO.File.ReadAllLines(@"D:\tese\RecoveryFiles\G" + Scene1Script.TestGroup + "PT3screenText.txt").ToList(); foreach (var l in tBox) { textBox.text += l + "\n"; } if (mainStory.variablesState["Sprite"].Equals("ClaireN")) { claireSprite.sprite = ClaireNeutral; claireSprite.gameObject.SetActive(true); } else if (mainStory.variablesState["Sprite"].Equals("ClaireH")) { claireSprite.sprite = ClaireHappy; claireSprite.gameObject.SetActive(true); } else if (mainStory.variablesState["Sprite"].Equals("ClaireV")) { claireSprite.sprite = ClaireVeryHappy; claireSprite.gameObject.SetActive(true); } if (char1story.variablesState["Other"].Equals("True")) { other1 = true; } else { other1 = false; } if (char2story.variablesState["Other"].Equals("True")) { other2 = true; } else { other2 = false; } if (Scene1Script.playerProun1 == 1) { if (mainStory.variablesState["AlexSprite"].Equals("Doubtful")) { alexSprite.sprite = alexMasDoubtful; } else if (mainStory.variablesState["AlexSprite"].Equals("Happy")) { alexSprite.sprite = alexMasHappy; } else if (mainStory.variablesState["AlexSprite"].Equals("Sidelook")) { alexSprite.sprite = alexMasSidelook; } else if (mainStory.variablesState["AlexSprite"].Equals("Smile")) { alexSprite.sprite = alexMasSmile; } else if (mainStory.variablesState["AlexSprite"].Equals("Smug")) { alexSprite.sprite = alexMasSmug; } } else { if (mainStory.variablesState["AlexSprite"].Equals("Doubtful")) { alexSprite.sprite = alexFemDoubtful; } else if (mainStory.variablesState["AlexSprite"].Equals("Happy")) { alexSprite.sprite = alexFemHappy; } else if (mainStory.variablesState["AlexSprite"].Equals("Sidelook")) { alexSprite.sprite = alexFemSidelook; } else if (mainStory.variablesState["AlexSprite"].Equals("Smile")) { alexSprite.sprite = alexFemSmile; } else if (mainStory.variablesState["AlexSprite"].Equals("Smug")) { alexSprite.sprite = alexFemSmug; } } if (Scene1Script.playerProun2 == 1) { if (mainStory.variablesState["JesseSprite"].Equals("Doubtful")) { jesseSprite.sprite = jesseMasDoubtful; } else if (mainStory.variablesState["JesseSprite"].Equals("Happy")) { jesseSprite.sprite = jesseMasHappy; } else if (mainStory.variablesState["JesseSprite"].Equals("Sidelook")) { jesseSprite.sprite = jesseMasSidelook; } else if (mainStory.variablesState["JesseSprite"].Equals("Smile")) { jesseSprite.sprite = jesseMasSmile; } else if (mainStory.variablesState["JesseSprite"].Equals("Smug")) { jesseSprite.sprite = jesseMasSmug; } } else { if (mainStory.variablesState["JesseSprite"].Equals("Doubtful")) { jesseSprite.sprite = jesseFemDoubtful; } else if (mainStory.variablesState["JesseSprite"].Equals("Happy")) { jesseSprite.sprite = jesseFemHappy; } else if (mainStory.variablesState["JesseSprite"].Equals("Sidelook")) { jesseSprite.sprite = jesseFemSidelook; } else if (mainStory.variablesState["JesseSprite"].Equals("Smile")) { jesseSprite.sprite = jesseFemSmile; } else if (mainStory.variablesState["JesseSprite"].Equals("Smug")) { jesseSprite.sprite = jesseFemSmug; } } } else { char1story.variablesState["giftJesse"] = GiftsChosen.giftJesse; char2story.variablesState["giftJesse"] = GiftsChosen.giftJesse; mainStory.variablesState["giftJesse"] = GiftsChosen.giftJesse; char1story.variablesState["giftAlex"] = GiftsChosen.giftAlex; char2story.variablesState["giftAlex"] = GiftsChosen.giftAlex; mainStory.variablesState["giftAlex"] = GiftsChosen.giftAlex; char1story.variablesState["numCakes"] = GiftsChosen.numCakes; char2story.variablesState["numCakes"] = GiftsChosen.numCakes; mainStory.variablesState["numCakes"] = GiftsChosen.numCakes; char1story.variablesState["AlexChocolate"] = GiftsChosen.AlexCakeChoc; char2story.variablesState["AlexChocolate"] = GiftsChosen.AlexCakeChoc; mainStory.variablesState["AlexChocolate"] = GiftsChosen.AlexCakeChoc; char1story.variablesState["JesseChocolate"] = GiftsChosen.JesseCakeChoc; char2story.variablesState["JesseChocolate"] = GiftsChosen.JesseCakeChoc; mainStory.variablesState["JesseChocolate"] = GiftsChosen.JesseCakeChoc; } char1story.ObserveVariable("Other", (variableName, value) => { other1 = ((string)value).Equals("true"); }); char2story.ObserveVariable("Other", (variableName, value) => { other2 = ((string)value).Equals("true"); }); UserReplyReceived += OnUserReplyReceived; mainStory.ObserveVariable("Background", (variableName, value) => { if (value.Equals("Kitchen")) { background.sprite = Kitchen; } else if (value.Equals("")) { background.sprite = null; } }); mainStory.ObserveVariable("Sprite", (variableName, value) => { if (value.Equals("ClaireN")) { claireSprite.sprite = ClaireNeutral; claireSprite.gameObject.SetActive(true); } else if (value.Equals("ClaireH")) { claireSprite.sprite = ClaireHappy; claireSprite.gameObject.SetActive(true); } else if (value.Equals("ClaireV")) { claireSprite.sprite = ClaireVeryHappy; claireSprite.gameObject.SetActive(true); } else if (value.Equals("")) { claireSprite.sprite = null; claireSprite.gameObject.SetActive(false); } }); mainStory.ObserveVariable("AlexSprite", (variableName, value) => { if (Scene1Script.playerProun1 == 1) { if (value.Equals("Doubtful")) { alexSprite.sprite = alexMasDoubtful; } else if (value.Equals("Happy")) { alexSprite.sprite = alexMasHappy; } else if (value.Equals("Sidelook")) { alexSprite.sprite = alexMasSidelook; } else if (value.Equals("Smile")) { alexSprite.sprite = alexMasSmile; } else if (value.Equals("Smug")) { alexSprite.sprite = alexMasSmug; } } else { if (value.Equals("Doubtful")) { alexSprite.sprite = alexFemDoubtful; } else if (value.Equals("Happy")) { alexSprite.sprite = alexFemHappy; } else if (value.Equals("Sidelook")) { alexSprite.sprite = alexFemSidelook; } else if (value.Equals("Smile")) { alexSprite.sprite = alexFemSmile; } else if (value.Equals("Smug")) { alexSprite.sprite = alexFemSmug; } } }); mainStory.ObserveVariable("JesseSprite", (variableName, value) => { if (Scene1Script.playerProun2 == 1) { if (value.Equals("Doubtful")) { jesseSprite.sprite = jesseMasDoubtful; } else if (value.Equals("Happy")) { jesseSprite.sprite = jesseMasHappy; } else if (value.Equals("Sidelook")) { jesseSprite.sprite = jesseMasSidelook; } else if (value.Equals("Smile")) { jesseSprite.sprite = jesseMasSmile; } else if (value.Equals("Smug")) { jesseSprite.sprite = jesseMasSmug; } } else { if (value.Equals("Doubtful")) { jesseSprite.sprite = jesseFemDoubtful; } else if (value.Equals("Happy")) { jesseSprite.sprite = jesseFemHappy; } else if (value.Equals("Sidelook")) { jesseSprite.sprite = jesseFemSidelook; } else if (value.Equals("Smile")) { jesseSprite.sprite = jesseFemSmile; } else if (value.Equals("Smug")) { jesseSprite.sprite = jesseFemSmug; } } }); ContinueStory(); }
protected override void Init() { SetBaseView(); dauY = new DoubleAnimationUsingKeyFrames(); dauOpacty = new DoubleAnimationUsingKeyFrames(); TranslateTransform translation = new TranslateTransform(0, 0); #region 基本工作,确定类型和name //是否存在TranslateTransform //动画要的类型是否存在 //动画要的类型的name是否存在,不存在就注册,结束后取消注册,删除动画 var ex = Element.RenderTransform; if (ex == null || (ex as System.Windows.Media.MatrixTransform) != null) { var tg = new TransformGroup(); translation = new TranslateTransform(0, 0); Win.RegisterName(translation.GetHashCode().ToString(), translation); tg.Children.Add(translation); Element.RenderTransform = tg; } else { var tg = ex as TransformGroup; foreach (var item in tg.Children) { translation = item as TranslateTransform; if (translation != null) { break; } } if (translation != null) { var tex = translation.GetValue(FrameworkElement.NameProperty); if (tex != null && tex.ToString() != "") { } else { Win.RegisterName(translation.GetHashCode().ToString(), translation); } } else { translation = new TranslateTransform(0, 0); Win.RegisterName(translation.GetHashCode().ToString(), translation); tg.Children.Add(translation); Element.RenderTransform = tg; } } #endregion Win.RegisterResource(Story); Story = (Storyboard)Story.CloneCurrentValue(); var k2 = new EasingDoubleKeyFrame(OneValue, TimeSpan.FromMilliseconds(0)); var k2_0 = new EasingDoubleKeyFrame(TwoValue, TimeSpan.FromMilliseconds(AniTime(0.6))); var k2_1 = new EasingDoubleKeyFrame(ThreeValue, TimeSpan.FromMilliseconds(AniTime(0.75))); var k2_2 = new EasingDoubleKeyFrame(FourValue, TimeSpan.FromMilliseconds(AniTime(0.9))); var k2_3 = new EasingDoubleKeyFrame(0, TimeSpan.FromMilliseconds(AniTime(1))); Storyboard.SetTargetName(dauY, Win.GetName(translation)); Storyboard.SetTargetProperty(dauY, new PropertyPath(TranslateTransform.XProperty)); dauY.KeyFrames.Add(k2); dauY.KeyFrames.Add(k2_0); dauY.KeyFrames.Add(k2_1); dauY.KeyFrames.Add(k2_2); dauY.KeyFrames.Add(k2_3); Story.Children.Add(dauY); var k3 = new EasingDoubleKeyFrame(0, TimeSpan.FromMilliseconds(AniTime(0))); var k3_0 = new EasingDoubleKeyFrame(1, TimeSpan.FromMilliseconds(AniTime(0.6))); var k3_1 = new EasingDoubleKeyFrame(1, TimeSpan.FromMilliseconds(AniTime(1))); dauOpacty.KeyFrames.Add(k3); dauOpacty.KeyFrames.Add(k3_0); dauOpacty.KeyFrames.Add(k3_1); Storyboard.SetTarget(dauOpacty, Element); dauOpacty.FillBehavior = FillBehavior.Stop; Storyboard.SetTargetProperty(dauOpacty, new PropertyPath(UIElement.OpacityProperty)); Story.Children.Add(dauOpacty); Story.Completed += Story_Completed; }
public void WhenIRequestInformationFromGetStoryState() { var games = new Games(loginContext, client, loginContext.cookie); story = games.GetStoryState(); }
/// <summary> /// Draws a property field for a story using GUI, allowing you to attach stories to the player window for debugging. /// </summary> /// <param name="position">Position.</param> /// <param name="story">Story.</param> /// <param name="label">Label.</param> public static void DrawStoryPropertyField(Rect position, Story story, GUIContent label) { Debug.LogWarning("DrawStoryPropertyField has been moved from InkEditorUtils to InkPlayerWindow"); }
private void addGiornataMondiale(Story l) { addOutPQ("#05", l); prog = 5; }
private static bool èInizioSalmo(Story s) { string l = s.getText(); return((l.StartsWith("dal salmo", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("1 sam", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("salmo", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("salmi", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("cant.", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("sal ", StringComparison.CurrentCultureIgnoreCase) || l.StartsWith("cant ", StringComparison.CurrentCultureIgnoreCase)) && l.Length < 40); }