public override void Receive(ThoughtFocus thoughtFocus) { Thought original = thoughtFocus.MainThought; if (thoughtFocus.RemoveThought && original != null) { Remove(original); } Topic topic = null; if (thoughtFocus.Topic != null) { topic = topicsByName[thoughtFocus.Topic]; } if (topic != null && topic.MyStage.Equals(Topic.Stage.Hidden)) { ExitTo(topic, Topic.Stage.Orientation); } foreach (String tangent in thoughtFocus.Tangents) { //Debug.Log("\"" + tangent + "\""); Topic tangentialTopic = topicsByName[tangent]; ExitTo(tangentialTopic, Topic.Stage.Orientation); if (tangentialTopic.MyStage.Equals(Topic.Stage.Complication)) { ShiftFocusChange(tangentialTopic, tangentialTopic.Focus + 3f, true, thoughtFocus.FinalMultiplier); } } TopicHeard(topic, thoughtFocus); }
private void TopicHeard(Topic topic, ThoughtFocus thoughtFocus) { if (topic != null) { switch (topic.MyStage) { case Topic.Stage.Orientation: Orientation(topic, thoughtFocus); break; case Topic.Stage.Complication: Complication(topic, thoughtFocus); break; case Topic.Stage.Climax: Climax(topic, thoughtFocus); break; case Topic.Stage.Denouement: Denouement(topic, thoughtFocus); break; case Topic.Stage.Coda: Coda(topic, thoughtFocus); break; } ShiftAllTopics(-0.02f, 0f, thoughtFocus.FinalMultiplier); } FocusThoughts(); }
private void Coda(Topic topic, ThoughtFocus thoughtFocus) { if (myInput.IsMe(thoughtFocus.MainThought.Actor) && thoughtFocus.MyStage.Equals(Topic.Stage.Coda)) { ExitTo(topic, Topic.Stage.Ended); } ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 5f, thoughtFocus.FinalMultiplier); }
private void Denouement(Topic topic, ThoughtFocus thoughtFocus) { if (thoughtFocus.MyStage.Equals(Topic.Stage.Coda)) { ExitTo(topic, Topic.Stage.Coda); } ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, false, 3f, thoughtFocus.FinalMultiplier); }
private void Orientation(Topic topic, ThoughtFocus thoughtFocus) { if (thoughtFocus.MyStage.Equals(Topic.Stage.Complication)) { ExitTo(topic, Topic.Stage.Complication); } ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 5f, thoughtFocus.FinalMultiplier); }
private void HandleStageOne(Thought thought) { ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.2f, false, false); Send(thoughtFocus); SocialInput socialInput = new SocialInput(thought.Actor, thought, 1); Send(socialInput); }
private void Climax(Topic topic, ThoughtFocus thoughtFocus) { float focusBefore = topic.Focus; ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 1f, thoughtFocus.FinalMultiplier); float focusAfter = topic.Focus; if (focusAfter < focusBefore) { ExitTo(topic, Topic.Stage.Denouement); } }
private void Complication(Topic topic, ThoughtFocus thoughtFocus) { if (thoughtFocus.MyStage.Equals(Topic.Stage.Climax)) { ExitTo(topic, Topic.Stage.Climax); } if (thoughtFocus.MyStage.Equals(Topic.Stage.Denouement)) { ExitTo(topic, Topic.Stage.Denouement); } ShiftFocusChangeDiminishing(topic, thoughtFocus.Complexity, true, 3f, thoughtFocus.FinalMultiplier); }
private void HandleStageThree(Thought thought) { ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.5f, true, true); Send(thoughtFocus); SocialInput socialInput = new SocialInput(thought.Actor, thought, 3); Send(socialInput); if (!myInput.IsMe(thought.Actor)) { foreach (Argument argument in thought.Arguments) { Argument newArgument = new Argument(argument.MyType, argument.Strength * 0.5f); Send(newArgument); } } }
private void HandleStageTwo(Thought thought) { ThoughtFocus thoughtFocus = new ThoughtFocus(thought, 0.3f, true, false); Send(thoughtFocus); SocialInput socialInput = new SocialInput(thought.Actor, thought, 2); Send(socialInput); if (!myInput.IsMe(thought.Actor)) { foreach (Argument argument in thought.Arguments) { Argument newArgument = new Argument(argument.MyType, argument.Strength * 0.5f); Send(newArgument); } } else { myInput.myStack.conversation.manager.CallEvent(thought.EventCode); } }
public void Route(ThoughtFocus thoughtFocus) => attention.Receive(thoughtFocus);
public abstract void Receive(ThoughtFocus thoughtFocus);
public void Send(ThoughtFocus thoughtFocus) { myInput.Route(thoughtFocus); }