Esempio n. 1
0
    //Scenes
    static public void RoomMovement(string origin, string destination)
    {
        ActionData newAction = new ActionData();

        newAction.Add("Origin", origin);
        newAction.Add("Destination", destination);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("RoomMovement", newAction));
    }
Esempio n. 2
0
    static public void OpenDiagram(string room, string diagramCode)
    {
        ActionData newAction = new ActionData();

        newAction.Add("Room", room);
        newAction.Add("DiagramCode", diagramCode);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("OpenDiagram", newAction));
    }
Esempio n. 3
0
    static public void AddNode(NodeData node)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", node.nodeName);
        newAction.Add("Type", node.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("AddNode", newAction));
    }
Esempio n. 4
0
    //Starting Log
    public void LogData()
    {
        ActionData newAction = new ActionData();
        string     date_time = DateTime.UtcNow.ToString("dd/MM/yyyy H:mm:ss (zzz)");

        newAction.Add("CaseID", playerCaseId);
        newAction.Add("DateTime", date_time);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("LogGeneralData", newAction));
    }
Esempio n. 5
0
    static public void ChangeCardinality(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", link.name);
        newAction.Add("New Cardinality", link.nodeState);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeCardinality", newAction));
    }
Esempio n. 6
0
    static public void RemLink(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Node1-Id", link.linkedNodeId[0].ToString());
        newAction.Add("Node2-Id", link.linkedNodeId[1].ToString());
        newAction.Add("Type", link.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("RemoveLink", newAction));
    }
Esempio n. 7
0
    static public void ChangeGenType(NodeData node, string oldState)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Id", node.id.ToString());
        newAction.Add("From", oldState);
        newAction.Add("To", node.nodeName);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeGenType", newAction));
    }
Esempio n. 8
0
    static public void ChangeMessageState(MessageData message, string oldState)
    {
        ActionData newAction = new ActionData();

        newAction.Add("Sender", message.entityCode);
        newAction.Add("Message", message.message);
        newAction.Add("oldState", oldState);
        newAction.Add("newState", message.state.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeMessageState", newAction));
    }
Esempio n. 9
0
    static public void ChangeParticipation(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", link.name);
        string participation = link.participationIsTotal ? "Total" : "Parcial";

        newAction.Add("New Participation", link.nodeState);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeParticipation", newAction));
    }
Esempio n. 10
0
    static public void ChangeGenLinkType(LinkData link, string oldType)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Node1-Id", link.linkedNodeId[0].ToString());
        newAction.Add("Node2-Id", link.linkedNodeId[1].ToString());
        newAction.Add("From", oldType);
        newAction.Add("To", link.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeGenLinkType", newAction));
    }
Esempio n. 11
0
    static public void ChangeKeyAttribute(NodeData node, string oldState)
    {
        ActionData newAction = new ActionData();
        string     keyValue  = "";

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", node.nodeName);
        newAction.Add("Id", node.id.ToString());
        newAction.Add("Type", node.type.ToString());
        keyValue = node.isKey ? "Es" : "No es";
        newAction.Add("Estado", keyValue + " atributo clave");
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeKeyAttribute", newAction));
    }
Esempio n. 12
0
    static public void DeleteDiagram(ERData node)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("DeleteDiagram", newAction));
    }
Esempio n. 13
0
    static public void SeeMessages(string sender)
    {
        ActionData newAction = new ActionData();

        newAction.Add("Sender", sender);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("SeeMessages", newAction));
    }
Esempio n. 14
0
        protected static bool LoadSocialData(BooterHelper.DocumentBootFile socialData)
        {
            if (!socialData.IsValid)
            {
                BooterLogger.AddError(socialData + ": Unknown SocialData File");
                return(false);
            }

            XmlElementLookup  lookup  = new XmlElementLookup(socialData.Document);
            List <XmlElement> actions = lookup["Action"];

            if ((actions == null) || (actions.Count == 0))
            {
                BooterLogger.AddError(socialData + ": No Action");
                return(false);
            }

            bool isEp5Installed = GameUtils.IsInstalled(ProductVersion.EP5);

            foreach (XmlElement element in actions)
            {
                XmlElementLookup table = new XmlElementLookup(element);

                CommodityTypes types;
                ParserFunctions.TryParseEnum <CommodityTypes>(element.GetAttribute("com"), out types, CommodityTypes.Undefined);

                ProductVersion version;
                ParserFunctions.TryParseEnum <ProductVersion>(element.GetAttribute("ver"), out version, ProductVersion.BaseGame);

                ActionData data = new ActionData(element.GetAttribute("key"), types, version, table, isEp5Installed);

                List <XmlElement> list = table["LHS"];
                if (list.Count > 0x0)
                {
                    SocialRuleLHS.sDictionary.Remove(data.Key);

                    foreach (XmlElement element3 in list)
                    {
                        SocialRuleLHS lhs = new SocialRuleLHS(data.Key, data.IntendedCommodityString, element3);
                        lhs.ProceduralPrecondition = FindMethod(element3.GetAttribute("ProcTest"));
                    }

                    SocialRuleLHS.Get(data.Key).Sort(new Comparison <SocialRuleLHS>(SocialRuleLHS.SortSocialRules));
                }

                ActionData.Add(data);

                BooterLogger.AddTrace(" " + data.Key + " Added");
            }

            return(true);
        }
Esempio n. 15
0
        public static void LoadSocialData(string spreadsheet)
        {
            XmlDocument root           = Simulator.LoadXML(spreadsheet);
            bool        isEp5Installed = GameUtils.IsInstalled(ProductVersion.EP5);

            if (spreadsheet != null)
            {
                XmlElementLookup  lookup = new XmlElementLookup(root);
                List <XmlElement> list   = lookup["Action"];
                foreach (XmlElement element in list)
                {
                    CommodityTypes   types;
                    XmlElementLookup table = new XmlElementLookup(element);
                    ParserFunctions.TryParseEnum <CommodityTypes>(element.GetAttribute("com"),
                                                                  out types, CommodityTypes.Undefined);
                    ActionData data = new ActionData(element.GetAttribute("key"),
                                                     types, ProductVersion.BaseGame, table, isEp5Installed);
                    ActionData.Add(data);
                }
            }
        }