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); }
public override void Receive(SocialInput socialInput) { if (myOutput.IsMe(socialInput.Actor)) { lastThought = socialInput.Thought; lastStage = socialInput.Stage; } else { lastHeardThought = socialInput.Thought; lastHeardStage = socialInput.Stage; lastHeardSpokeAt = Time.time; } ImpReceive(socialInput); }
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(SocialInput socialInput) => myStack.outputStack.Route(socialInput);
public override void ImpReceive(SocialInput socialInput) { return; }
public void Route(SocialInput socialInput) => decider.Receive(socialInput);
public abstract void ImpReceive(SocialInput socialInput);
public bool Execute(Account acc, ItemData data, SocialInput input) { string filePath = _settings[acc.Type + "File"]; XmlDocument doc = new XmlDocument(); doc.Load(filePath); XmlElement postNode = doc.CreateElement("Post"); postNode.SetAttribute("account", acc.Email); postNode.SetAttribute("date", input.Date); postNode.SetAttribute("delay", input.Propagate.ToString()); postNode.SetAttribute("type", "C"); XmlElement passNode = doc.CreateElement("Password"); passNode.InnerText = acc.Password; postNode.AppendChild(passNode); XmlElement nameNode = doc.CreateElement("Name"); nameNode.InnerText = acc.Name; postNode.AppendChild(nameNode); XmlElement nickNode = doc.CreateElement("Nickname"); nickNode.InnerText = acc.Nickname; postNode.AppendChild(nickNode); XmlElement imgNode = doc.CreateElement("AvatarImage"); imgNode.InnerText = acc.AvatarImage; postNode.AppendChild(imgNode); string text = ""; string linkURL = ""; string templateId = templateId = data.ComponentTemplateId;; if (input.GetTextFromItem) { templateId = _settings["ComponentTemplate" + acc.Type]; if (templateId == TcmUri.UriNull.ToString()) { templateId = data.ComponentTemplateId; } text = RenderItem(data.ComponentId, templateId); } else { text = input.Text; } XmlElement textNode = doc.CreateElement("Text"); XmlCDataSection cdata = doc.CreateCDataSection(text); textNode.AppendChild(cdata); postNode.AppendChild(textNode); if (input.GetLink) { linkURL = _settings["LinkURL"] + "?componentId=" + data.ComponentId + "&templateId=" + templateId; } XmlElement linkNode = doc.CreateElement("Link"); linkNode.InnerText = linkURL; postNode.AppendChild(linkNode); doc.DocumentElement.InsertBefore(postNode, doc.DocumentElement.FirstChild); doc.Save(filePath); return(true); }
public void Send(SocialInput socialInput) { myInput.Route(socialInput); }