Esempio n. 1
0
    public void RegisterConversationalPartner(string conversationalPartnerID)
    {
        if (conversationalPartnerID == "")
        {
            Debug.LogError("Conversational partner ID not provided");
        }

        if (_conversationalPartnerID != conversationalPartnerID)
        {
            _conversationalPartnerID = conversationalPartnerID;

            currentDialogueObject = MasterSerializer.RetrieveDialogueObject(conversationalPartnerID);
        }

        string textContents = currentDialogueObject[ENTRY_NAME][TEXT_NAME].str;

        JSONObject    clickableTermsObject = currentDialogueObject[ENTRY_NAME][CLICKABLE_TERMS_NAME];
        List <string> clickableTerms       = new List <string>();

        foreach (JSONObject j in clickableTermsObject.list)
        {
            clickableTerms.Add(j.str);
        }

        dialogueBubbleMatrix[0, 0].ActivateBubble(textContents, clickableTerms);
    }
Esempio n. 2
0
        public string Dissolve(object source)
        {
            StringBuilder output = new StringBuilder();

            if (source is ArrayList)
            {
                ArrayList al = source as ArrayList;
                string    s_val;
                foreach (object val in al)
                {
                    s_val = val.GetType().FullName + "|";
                    if (MasterSerializer.IsSimpleType(val))
                    {
                        s_val += "H|";
                        s_val += ReadableSerialize(MasterSerializer.Dissolve(val));
                    }
                    else
                    {
                        s_val += "B|";
                        s_val += ConvertUTF8ToBytes(MasterSerializer.Dissolve(val));
                    }

                    output.Append(s_val);
                    output.Append(";");
                }
            }

            return(output.ToString());
        }
Esempio n. 3
0
 private void OnEnable()
 {
     if (MasterSerializer.GetObjectState(stateBoolTag))
     {
         hasMoved = true;
         StartCoroutine(ChangePosition());
     }
 }
Esempio n. 4
0
    public void Move()
    {
        if (hasMoved)
        {
            return;
        }

        hasMoved = true;
        MasterSerializer.FlagSceneState(stateBoolTag);
        StartCoroutine(ChangePosition());
    }
Esempio n. 5
0
        public object Reconstitute(string source)
        {
            ArrayList al = new ArrayList();

            string[] sets = source.Split(';');
            string[] typeset;
            string   s_val;

            //------------------------
            // 'B' = Base64
            // 'H' = Human Readable
            //------------------------
            string mode = "B";
            object val;
            Type   type;

            foreach (string strval in sets)
            {
                val   = null;
                s_val = strval;

                typeset = s_val.Split('|');

                if (typeset.Length == 3)
                {
                    mode = typeset[1];
                }
                else
                {
                    mode = "B";
                }

                if (typeset.Length >= 2)
                {
                    type = Type.GetType(typeset[0]);

                    if (mode == "B")
                    {
                        val = MasterSerializer.Reconstitute(type, ConvertBytesToUTF8(typeset[typeset.Length - 1]));
                    }
                    else
                    {
                        val = MasterSerializer.Reconstitute(type, ReadableDeserialize(typeset[typeset.Length - 1]));
                    }
                }

                if (val != null)
                {
                    al.Add(val);
                }
            }

            return(al);
        }
Esempio n. 6
0
    public void GeneratePassiveHardwareTooltip(int passiveHardwareSlot)
    {
        HardwareType hardwareType       = draggingHardwareType != HardwareType.None ? draggingHardwareType : InventoryController.GetEquippedPassiveHardware()[passiveHardwareSlot];
        HardwareType activeHardwareType = InventoryController.GetEquippedActiveHardware()[passiveHardwareSlot];

        if (hardwareType == HardwareType.None || activeHardwareType == HardwareType.None)
        {
            return;
        }

        string hardwareDescription = MasterSerializer.GetSpecificHardwareDescription(hardwareType, activeHardwareType);

        menuManager.PopulateInformationText(hardwareType.ToString(), hardwareDescription);
    }
Esempio n. 7
0
        public string Dissolve(object source)
        {
            StringBuilder output = new StringBuilder();

            if (source is Hashtable)
            {
                Hashtable ht = source as Hashtable;
                object    val;
                string    s_key, s_val;

                foreach (object key in ht.Keys)
                {
                    val = ht[key];

                    s_key = key.GetType().FullName + "|";
                    s_val = val.GetType().FullName + "|";

                    if (MasterSerializer.IsSimpleType(key))
                    {
                        s_key += "H|";
                        s_key += ReadableSerialize(MasterSerializer.Dissolve(key));
                    }
                    else
                    {
                        s_key += "B|";
                        s_key += ConvertUTF8ToBytes(MasterSerializer.Dissolve(key));
                    }

                    if (MasterSerializer.IsSimpleType(val))
                    {
                        s_val += "H|";
                        s_val += ReadableSerialize(MasterSerializer.Dissolve(val));
                    }
                    else
                    {
                        s_val += "B|";
                        s_val += ConvertUTF8ToBytes(MasterSerializer.Dissolve(val));
                    }

                    output.Append(s_key);
                    output.Append(",");
                    output.Append(s_val);
                    output.Append(";");
                }
            }

            return(output.ToString());
        }
Esempio n. 8
0
        public object Reconstitute(string source)
        {
            SimpleTable st = new SimpleTable();

            string[]  rows = source.Split(';');
            string[]  items, typeset;
            string    s_val;
            object    val;
            Type      type;
            SimpleRow sr = null;
            int       colIndex = 0, rowIndex = 0;

            //------------------------
            // 'B' = Base64
            // 'H' = Human Readable
            //------------------------
            string mode = "B";

            foreach (string row in rows)
            {
                if (row.Trim() != string.Empty)
                {
                    items = row.Split(',');

                    if (rowIndex > 0)
                    {
                        sr = st.Rows.Add();
                    }

                    colIndex = 0;
                    foreach (string item in items)
                    {
                        val = null;

                        s_val = item;

                        typeset = s_val.Split('|');
                        if (rowIndex == 0)
                        {
                            st.Columns.Add(ReadableDeserialize(typeset[1]));
                        }
                        else
                        {
                            mode = "B";
                            if (typeset.Length == 3)
                            {
                                mode = typeset[1];
                            }

                            if (typeset.Length >= 2)
                            {
                                type = Type.GetType(typeset[0]);
                                if (mode == "B")
                                {
                                    val = MasterSerializer.Reconstitute(type, ConvertBytesToUTF8(typeset[typeset.Length - 1]));
                                }
                                else
                                {
                                    val = MasterSerializer.Reconstitute(type, ReadableDeserialize(typeset[typeset.Length - 1]));
                                }
                            }

                            sr[colIndex] = val;
                        }
                        colIndex++;
                    }

                    rowIndex++;
                }
            }

            return(st);
        }
Esempio n. 9
0
        public string Dissolve(object source)
        {
            StringBuilder output = new StringBuilder();

            if (source is SimpleTable)
            {
                SimpleTable table = source as SimpleTable;
                object      val;
                string      s_val;

                if (table.Columns.Count > 0)
                {
                    bool first = true;
                    foreach (SimpleColumn column in table.Columns)
                    {
                        if (first)
                        {
                            first = false;
                        }
                        else
                        {
                            output.Append(",");
                        }

                        output.Append("Column|");
                        output.Append(ReadableSerialize(column.Name));
                    }
                    output.Append(";");

                    if (table.Rows.Count > 0)
                    {
                        foreach (SimpleRow row in table.Rows)
                        {
                            first = true;
                            foreach (SimpleColumn column in table.Columns)
                            {
                                if (first)
                                {
                                    first = false;
                                }
                                else
                                {
                                    output.Append(",");
                                }

                                val = row[column];

                                s_val = val.GetType().FullName + "|";

                                if (MasterSerializer.IsSimpleType(val))
                                {
                                    s_val += "H|";
                                    s_val += ReadableSerialize(MasterSerializer.Dissolve(val));
                                }
                                else
                                {
                                    s_val += "B|";
                                    s_val += ConvertUTF8ToBytes(MasterSerializer.Dissolve(val));
                                }

                                output.Append(s_val);
                            }
                            output.Append(";");
                        }
                    }
                }
            }

            return(output.ToString());
        }
Esempio n. 10
0
        public object Reconstitute(string source)
        {
            Hashtable ht = new Hashtable();

            string[] pairs = source.Split(';');
            string[] pair, typeset;
            string   s_key, s_val;
            object   key, val;
            Type     type;

            //------------------------
            // 'B' = Base64
            // 'H' = Human Readable
            //------------------------
            string mode = "B";

            foreach (string strpair in pairs)
            {
                pair = strpair.Split(',');
                if (pair.Length == 2)
                {
                    key = null;
                    val = null;

                    s_key = pair[0];
                    s_val = pair[1];

                    typeset = s_key.Split('|');
                    mode    = "B";
                    if (typeset.Length == 3)
                    {
                        mode = typeset[1];
                    }

                    if (typeset.Length >= 2)
                    {
                        type = Type.GetType(typeset[0]);
                        if (mode == "B")
                        {
                            key = MasterSerializer.Reconstitute(type, ConvertBytesToUTF8(typeset[typeset.Length - 1]));
                        }
                        else
                        {
                            key = MasterSerializer.Reconstitute(type, ReadableDeserialize(typeset[typeset.Length - 1]));
                        }
                    }

                    typeset = s_val.Split('|');
                    mode    = "B";
                    if (typeset.Length == 3)
                    {
                        mode = typeset[1];
                    }

                    if (typeset.Length >= 2)
                    {
                        type = Type.GetType(typeset[0]);
                        if (mode == "B")
                        {
                            val = MasterSerializer.Reconstitute(type, ConvertBytesToUTF8(typeset[typeset.Length - 1]));
                        }
                        else
                        {
                            val = MasterSerializer.Reconstitute(type, ReadableDeserialize(typeset[typeset.Length - 1]));
                        }
                    }

                    if ((key != null) && (val != null))
                    {
                        ht[key] = val;
                    }
                }
            }

            return(ht);
        }
Esempio n. 11
0
    public void RenewableInventoryMenu_PointerEnter(RenewableTypes renewableType)
    {
        string renewableDescription = MasterSerializer.GetRenewableDescription(renewableType);

        menuManager.PopulateInformationText(renewableType.ToString(), renewableDescription);
    }
Esempio n. 12
0
    public void HardwareInventoryMenu_PointerEnter(HardwareType hardwareType)
    {
        string hardwareDescription = MasterSerializer.GetGeneralHardwareDescription(hardwareType);

        menuManager.PopulateInformationText(hardwareType.ToString(), hardwareDescription);
    }