コード例 #1
0
        public HttpResponse AuthenticateUser(EventPlanner user)
        {
            try
            {
                Authenticate(user.Username, user.Password);
            }
            catch (Exception e)
            {
                return(null);
            }

            return(null);
        }
コード例 #2
0
ファイル: DemoPlanning.cs プロジェクト: fgeraci/CS195-Core
	// Update is called once per frame
	void Update () {

		if(Input.GetKeyDown(KeyCode.P)) {

//			foreach (EventSignature sig in EventLibrary.Instance.GetSignatures())
//				Debug.Log(sig.ToString());

			actor0.Set (StateName.RoleActor, StateName.IsStanding);
			actor1.Set (StateName.RoleActor, StateName.IsStanding);
			chair.Set (StateName.RoleChair);
			table.Set (StateName.RoleTable, StateName.HoldingBall);

			ePlanner = new EventPlanner(stateSpaceManager); //, AuthoredEventManager.instance);

			EventSignature sitDown = EventLibrary.Instance.GetSignaturesOfType(typeof(SitDown)).First();
			EventSignature take = EventLibrary.Instance.GetSignaturesOfType(typeof(Take)).First();
			EventSignature give = EventLibrary.Instance.GetSignaturesOfType(typeof(Give)).First();
//			Transition startEvent = new Transition(sitDown, actor0.Id, chair.Id);
//			Transition endEvent = new Transition(sitDown, actor1.Id, chair.Id);

			StoryArc arc = new StoryArc(
								new StoryBeat(new StoryEvent(give, uint.MaxValue, uint.MaxValue)),
								new StoryBeat(new StoryEvent(take, uint.MaxValue, uint.MaxValue))
								);

			//arc = ePlanner.completeStoryArcUpTo(arc.Beats.Length, arc, null, PlanSpace.All);
			if(ePlanner.plan.Count>0)
				ePlanner.plan.Pop ();

			while(ePlanner.plan.Count>0) {
				Transition cur = (Transition)ePlanner.plan.Pop();
				Debug.Log(cur.eventSig.ToString() + "with arguments " + + cur.eventIndexToID(0)+ " "+ cur.eventIndexToID(1));
			}
			foreach(StoryBeat b in arc.Beats) {
				Debug.Log("new Beat:");
				foreach(StoryEvent e in b.Events)
					Debug.Log(e.Signature.ToString() + " with arguments: " + e.Participants[0] + e.Participants[1]);
			}
		}
	}
コード例 #3
0
ファイル: MainWindow.cs プロジェクト: fgeraci/CS195-Core
    /// <summary>
    /// Plan locally for a given level.
    /// </summary>
    private void PlanLocal(int level)
    {
		StoryArc arc = manager.ToStoryArc();
		
		EventPlanner ePlanner = new EventPlanner(stateSpaceManager);
		bool success=false;
		arc = ePlanner.planGlobalUpTo(level+1, arc, rectangleForObject.Keys, OPTION, ref success);
		manager.ClearAllEvents();
		manager.ImportStoryArc(arc);
        HighlightPlannedEvents(ePlanner.IDs);
    }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: fgeraci/CS195-Core
    /// <summary>
    /// Plan across the entire event space.
    /// </summary>
    private void PlanGlobal()
    {
		Rules.ClearCache ();
		StoryArc arc = manager.ToStoryArc();
		undoArc = arc;

		EventPlanner ePlanner = new EventPlanner(stateSpaceManager);
		bool success = false;
		arc = ePlanner.planGlobal(arc, rectangleForObject.Keys, OPTION, ref success);
		arc = ePlanner.depopulateArc (arc); //removes the implicit Paramteres again
		manager.ClearAllEvents();
		manager.ImportStoryArc(arc);
        HighlightPlannedEvents(ePlanner.IDs);
    }
コード例 #5
0
 private void Authenticate(string username, string password)
 {
     currentUser = new EventPlanner();
 }