1 /*
2  *  CVS: $Id: DialogObject.java,v 1.4 2004/07/16 16:22:33 marcus Exp $
3  * 
4  *  This file is part of JZuul.
5  *
6  *  JZuul is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10 *
11 *  JZuul is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with Zuul; if not, write to the Free Software
18 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 * 
20 *  Copyrigth 2004 by marcus, leh
21 * 
22 */
23
24package org.jzuul.engine;
25
26/**
27 * Ein DialogObject ist ein Element eines gesamten Dialoges
28 * 
29 * 
30 * @version $Revision: 1.4 $
31  */
32public class DialogObject {
33    /**
34     * Der Satz den der Spieler zur Auswahl bekommt
35     */
36    protected String playerSentence;
37    /**
38     * Die Antwort die ein Character Objekt zu der Auswahl des Spielers gibt
39     */
40    protected String npcAnswer;
41    /**
42     * Die Phase zu der dieses DialogObject Objekt gehört
43     */
44    int phase;
45    /**
46     * Der Typ den dieses DialogObject als Rückgabewert liefert
47     */
48    int type;
49    /**
50     * Ein Verweis auf die nächste Dialogphase, default ist 0 
51     */
52    int nextPhase;
53    /**
54     * Die eindeutige Id dieses DialogObject Objekt
55     */
56    int id;
57
58    /**
59     * Erstellt ein neues DialogObject Objekt
60     * 
61     * @param phase die Phase zu der dieses DialogObject gehört
62     * @param id            die eindeutige Id des DialogObject Objektes
63     * @param playerSentence    die Aussage die der Spieler zur Auswahl hat
64     * @param npcAnswer             die Antwort die ein Character Objekt darauf gibt
65     * @param nextPhase             die nächste Phase für einen Success, sonst 0
66     * @param type                          der Typ dieses DialogObject Objektes, wird als Event ausgelöst
67     */
68    public DialogObject(int phase, int id, String playerSentence, String npcAnswer, int nextPhase, int type) {
69        this.phase = phase;
70        this.playerSentence = playerSentence;
71        this.npcAnswer = npcAnswer;
72        this.type = type;
73        this.nextPhase = nextPhase;
74        this.id = id;
75    }
76
77    /**
78     * Zugriff auf die ID des Objektes
79     * 
80     * @return  Die ID des Objektes
81     */
82    public int getId() {
83        return id;
84    }
85
86    /**
87     * Zugriff auf den Antwortsatz eines Charakters
88     * 
89     * @return  Die Antwort des Charactes auf einen Satz des Spielers
90     */
91    public String getNpcAnswer() {
92        return npcAnswer;
93    }
94
95    /**
96     * Zugriff auf die Phase dieses DialogObject Objektes
97     * 
98     * @return  Die Phase zu der dieses DialogObject gehört (nur die initiale, aliase werden nicht berücksichtigt)
99     */
00    public int getPhase() {
01        return phase;
02    }
03
04    /**
05     * Zugriff auf die Aussage des Spielers
06     * 
07     * @return  Die Aussage des Spielers
08     */
09    public String getPlayerSentence() {
10        return playerSentence;
11    }
12
13    /**
14     * Zugriff auf den Typen des Objektes. Wird als Event ausgelöst.
15     * 
16     * @return  Den Typen des Objektes
17     * @see     org.jzuul.engine.Event
18     */
19    public int getType() {
20        return type;
21    }
22
23    /**
24     * Die Phase auf die dieses DialogObject verweist.
25     * 
26     * @return Die darauffolgende Phase
27     */
28    public int getNextPhase() {
29        return this.nextPhase;
30    }
31}
32