コード例 #1
0
    public void OnAddSpeciesToEntity(List <string> speciesNames)
    {
        DF2Entity[] entities = new DF2Entity[speciesNames.Count];
        int         i        = 0;

        foreach (string s in speciesNames)
        {
            entities[i] = new DF2Entity(s, s);
            i++;
        }

        DF2EntityType names = new DF2EntityType("UserCreatedSpecies", DF2EntityType.DF2EntityOverrideMode.ENTITY_OVERRIDE_MODE_SUPPLEMENT, entities);

        DF2Client.Instance.Client.AddEntityType(names, DF2Client.Instance.SessionName);
    }
コード例 #2
0
    public void SendText()
    {
        DF2Entity     name0    = new DF2Entity("George", "George");
        DF2Entity     name1    = new DF2Entity("Greg", "Greg");
        DF2Entity     potion   = new DF2Entity("Potion", "Potion", "Cure", "Healing potion");
        DF2Entity     antidote = new DF2Entity("Antidote", "Antidote", "Poison cure");
        DF2EntityType names    = new DF2EntityType("names", DF2EntityType.DF2EntityOverrideMode.ENTITY_OVERRIDE_MODE_SUPPLEMENT,
                                                   new DF2Entity[] { name0, name1 });
        DF2EntityType items = new DF2EntityType("items", DF2EntityType.DF2EntityOverrideMode.ENTITY_OVERRIDE_MODE_SUPPLEMENT,
                                                new DF2Entity[] { potion, antidote });

        client.AddEntityType(names, name);
        client.AddEntityType(items, name);

        client.DetectIntentFromText(content.text, session.text);
    }