WriteString() public method

public WriteString ( string v ) : void
v string
return void
Ejemplo n.º 1
0
 public void Pack(StreamPacker sp)
 {
     sp.WriteString(objectName);
     sp.WriteString(method);
     sp.WriteStrings(paramaters);
     sp.WriteBool(assignment);
 }
Ejemplo n.º 2
0
    public static void Save(StreamPacker sp)
    {
        // Pack all quests
        List<Quest> quests=Parley.GetInstance().GetCompletedQuests();
        sp.WriteInt(quests.Count);
        foreach(Quest q in quests){
            PackQuest(sp,q);
        }

        quests=Parley.GetInstance().GetCurrentQuests();
        sp.WriteInt(quests.Count);
        foreach(Quest q in quests){
            PackQuest(sp,q);
        }
        sp.WriteString("Pack1");

        // Pack all events
        HashSet<string> questEvents=Parley.GetInstance().GetQuestEventSet();
        string[] allEvents=new string[questEvents.Count];
        int c=0;
        foreach (string s in questEvents){
            allEvents[c++]=s;
        }
        sp.WriteStrings(allEvents);

        sp.WriteString("Pack2");

        // Pack all active quest events
        sp.WriteInt(Parley.GetInstance().GetActiveEvents().Count);
        foreach (string s in Parley.GetInstance().GetActiveEvents()){
            sp.WriteString(s);
        }
        sp.WriteString("Pack3");
    }
Ejemplo n.º 3
0
    public static void Save(StreamPacker sp)
    {
        // Pack all quests
        List <Quest> quests = Parley.GetInstance().GetCompletedQuests();

        sp.WriteInt(quests.Count);
        foreach (Quest q in quests)
        {
            PackQuest(sp, q);
        }

        quests = Parley.GetInstance().GetCurrentQuests();
        sp.WriteInt(quests.Count);
        foreach (Quest q in quests)
        {
            PackQuest(sp, q);
        }
        sp.WriteString("Pack1");

        // Pack all events
        HashSet <string> questEvents = Parley.GetInstance().GetQuestEventSet();

        string[] allEvents = new string[questEvents.Count];
        int      c         = 0;

        foreach (string s in questEvents)
        {
            allEvents[c++] = s;
        }
        sp.WriteStrings(allEvents);

        sp.WriteString("Pack2");

        // Pack all active quest events
        sp.WriteInt(Parley.GetInstance().GetActiveEvents().Count);
        foreach (string s in Parley.GetInstance().GetActiveEvents())
        {
            sp.WriteString(s);
        }
        sp.WriteString("Pack3");
    }
Ejemplo n.º 4
0
    override public void Pack(StreamPacker sp)
    {
        sp.WriteInt(conversations.Length);

        foreach (Conversation c in conversations)
        {
            sp.WriteInt(c.id);
            sp.WriteInt(c.returnId);
            sp.WriteInt(c.uniqueId);
            sp.WriteString(c.text);
            sp.WriteString(c.repeattext);
            sp.WriteBool(c.once);
            sp.WriteBool(c.fallthrough);
            sp.WriteString(c.questevent);
            sp.WriteObjects(c.playerCommands);
            sp.WriteString(c.questrequirement);
            sp.WriteString(c.environmentalrequirement);
            sp.WriteBool(c._available);
            sp.WriteBool(c._seen);

            sp.WriteInt(c.options.Length);
            foreach (Option o in c.options)
            {
                sp.WriteString(o.text);
                sp.WriteInt(o.destinationId);
                sp.WriteBool(o._available);
                sp.WriteBool(o.choosenb4);
                sp.WriteBool(o.quest);
            }
        }
    }
Ejemplo n.º 5
0
    public void Save(string file)
    {
        FileStream fs = new FileStream(file, FileMode.Create);

        StreamPacker sp = new StreamPacker(fs);

        // Save Parley
        ParleySaveLoad.Save(sp);

        sp.WriteString("All is well");

        // Save all the Objects
        foreach (GameObject go in packableObjects)
        {
            PackUnpackableBehaviour[] pus = (PackUnpackableBehaviour[])go.GetComponents <PackUnpackableBehaviour>();
            if (pus != null && pus.Length > 0)
            {
                foreach (PackUnpackableBehaviour pu in pus)
                {
                    sp.WriteString(pu.GetType().Name);
                    pu.Pack(sp);
                }
            }
            pus = (PackUnpackableBehaviour[])go.GetComponentsInChildren <PackUnpackableBehaviour>(true);
            if (pus != null && pus.Length > 0)
            {
                foreach (PackUnpackableBehaviour pu in pus)
                {
                    sp.WriteString(pu.GetType().Name);
                    pu.Pack(sp);
                }
            }
        }

        fs.Close();
    }
Ejemplo n.º 6
0
    private static void PackQuest(StreamPacker sp, Quest q)
    {
        sp.WriteString(q.name);
        sp.WriteInt(q.uniqueId);
        sp.WriteString(q.description);
        sp.WriteString(q.handinDescription);
        sp.WriteString(q.afterDescription);
        sp.WriteString(q.questevent);
        sp.WriteString(q.activeevent);
        sp.WriteObjects(q.playerCommands);
        sp.WriteString(q.questrequirement);
        sp.WriteBool(q.open);
        sp.WriteBool(q.completed);
        sp.WriteString(q.status);
        sp.WriteFloat(q.lastEffected - Time.time);

        sp.WriteInt(q.objectives.Count);
        foreach (Objective o in q.objectives)
        {
            sp.WriteString(o.description);
            sp.WriteString(o.doneDescription);
            sp.WriteString(o.locationObject);
            sp.WriteInt(o.count);
            sp.WriteBool(o.optional);
            sp.WriteString(o.objectiveevent);
            sp.WriteString(o.questevent);
            sp.WriteString(o.activeevent);
            sp.WriteObjects(o.playerCommands);
            sp.WriteString(o.questrequirement);
            sp.WriteBool(o.completed);
            sp.WriteBool(o.open);
        }
    }
Ejemplo n.º 7
0
 public void Pack(StreamPacker sp)
 {
     sp.WriteString(objectName);
     sp.WriteString(method);
     sp.WriteStrings(paramaters);
     sp.WriteBool(assignment);
 }
Ejemplo n.º 8
0
    private static void PackQuest(StreamPacker sp,Quest q)
    {
        sp.WriteString(q.name);
        sp.WriteInt(q.uniqueId);
        sp.WriteString(q.description);
        sp.WriteString(q.handinDescription);
        sp.WriteString(q.afterDescription);
        sp.WriteString(q.questevent);
        sp.WriteString(q.activeevent);
        sp.WriteObjects(q.playerCommands);
        sp.WriteString(q.questrequirement);
        sp.WriteBool(q.open);
        sp.WriteBool(q.completed);
        sp.WriteString(q.status);
        sp.WriteFloat(q.lastEffected-Time.time);

        sp.WriteInt(q.objectives.Count);
        foreach (Objective o in q.objectives){
            sp.WriteString(o.description);
            sp.WriteString(o.doneDescription);
            sp.WriteString(o.locationObject);
            sp.WriteInt(o.count);
            sp.WriteBool(o.optional);
            sp.WriteString(o.objectiveevent);
            sp.WriteString(o.questevent);
            sp.WriteString(o.activeevent);
            sp.WriteObjects(o.playerCommands);
            sp.WriteString(o.questrequirement);
            sp.WriteBool(o.completed);
            sp.WriteBool(o.open);
        }
    }
Ejemplo n.º 9
0
    public override void Pack(StreamPacker sp)
    {
        sp.WriteInt(conversations.Length);

        foreach (Conversation c in conversations){
            sp.WriteInt(c.id);
            sp.WriteInt(c.returnId);
            sp.WriteInt(c.uniqueId);
            sp.WriteString(c.text);
            sp.WriteString(c.repeattext);
            sp.WriteBool(c.once);
            sp.WriteBool(c.fallthrough);
            sp.WriteString(c.questevent);
            sp.WriteObjects(c.playerCommands);
            sp.WriteString(c.questrequirement);
            sp.WriteString(c.environmentalrequirement);
            sp.WriteBool(c._available);
            sp.WriteBool(c._seen);

            sp.WriteInt(c.options.Length);
            foreach (Option o in c.options){
                sp.WriteString(o.text);
                sp.WriteInt(o.destinationId);
                sp.WriteBool(o._available);
                sp.WriteBool(o.choosenb4);
                sp.WriteBool(o.quest);
            }
        }
    }
Ejemplo n.º 10
0
    public void Save(string file)
    {
        FileStream fs = new FileStream(file, FileMode.Create);

        StreamPacker sp=new StreamPacker(fs);

        // Save Parley
        ParleySaveLoad.Save(sp);

        sp.WriteString("All is well");

        // Save all the Objects
        foreach (GameObject go in packableObjects){
            PackUnpackableBehaviour[] pus=(PackUnpackableBehaviour[])go.GetComponents<PackUnpackableBehaviour>();
            if (pus!=null && pus.Length>0){
                foreach (PackUnpackableBehaviour pu in pus){
                    sp.WriteString(pu.GetType().Name);
                    pu.Pack(sp);
                }
            }
            pus=(PackUnpackableBehaviour[])go.GetComponentsInChildren<PackUnpackableBehaviour>(true);
            if (pus!=null && pus.Length>0){
                foreach (PackUnpackableBehaviour pu in pus){
                    sp.WriteString(pu.GetType().Name);
                    pu.Pack(sp);
                }
            }
        }

        fs.Close();
    }