WriteInt() public method

public WriteInt ( int v ) : void
v int
return void
Esempio n. 1
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);
        }
    }
    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");
    }
Esempio n. 3
0
 public override void Pack(StreamPacker sp)
 {
     SaveLoadTransform.PackTransform(gameObject.transform, sp);
     sp.WriteBool(showgold);
     sp.WriteFloat(gold);
     sp.WriteBool(showwildflowers);
     sp.WriteInt(wildflowers);
     sp.WriteBool(broadcastjumps);
 }
Esempio n. 4
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");
    }
Esempio n. 5
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);
            }
        }
    }
    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);
        }
    }
Esempio n. 7
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);
            }
        }
    }