plant.c-Dateireferenz

#include <properties.h>
#include "../files.h"
Include-Abhängigkeitsdiagramm für plant.c:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define PLANT_LIFETIME   (24*3600)
#define DRIED_PLANT   -1

Funktionen

int PlantQuality ()
void DryPlant (int qual)
int TimeToLive ()
nomask int SetPlantId (int id)
nomask int QueryPlantId ()
varargs create (string file)
string short ()
static int _query_value ()
nomask string QueryCloner ()

Variablen

inherit std thing
int age = time()
static private int plantId
static private string cloner

Makro-Dokumentation

#define DRIED_PLANT   -1

Definiert in Zeile 9 der Datei plant.c.

Wird benutzt von DryPlant() und short().

#define PLANT_LIFETIME   (24*3600)

Definiert in Zeile 8 der Datei plant.c.

Wird benutzt von PlantQuality(), short() und TimeToLive().


Dokumentation der Funktionen

static int _query_value (  )  [static]

Definiert in Zeile 71 der Datei plant.c.

Benutzt P_VALUE, plantId, PlantQuality() und Query().

00072 {
00073    int val;
00074    if (plantId<=0)
00075       return 0;
00076    val=Query(P_VALUE)*PlantQuality()/100;
00077    if (val<0) return 0;
00078    return val-val%10;
00079 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

varargs create ( string  file  ) 

Definiert in Zeile 24 der Datei plant.c.

Benutzt create(), KRAEUTERVC, P_MATERIAL, P_QUALITY, P_VALUE, P_WEIGHT, plantId und SetProp().

00025 {
00026    // auch die Blueprint _muss_ initialisiert sein!
00027    thing::create();
00028    plantId=0;
00029    SetProp(P_QUALITY, 100);
00030    SetProp(P_WEIGHT, 120);
00031    SetProp(P_VALUE, 70);
00032    // _unbedingt_ umsetzen bei Zutaten die keine Pflanzen sind!
00033    SetProp(P_MATERIAL, MAT_MISC_PLANT);
00034    // hier darf _nicht_ previous_object()->CustomizeObject() verwandt werden,
00035    // da nur die Blueprint wirklich vom VC geclont wird. Fuer die Clones
00036    // ruft der Master den VC nicht jedesmal erneut auf.
00037    if (stringp(file)) file=explode(file, "/")[<1];
00038    call_other(KRAEUTERVC, "CustomizeObject", file);
00039 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

void DryPlant ( int  qual  ) 

Definiert in Zeile 81 der Datei plant.c.

Benutzt age, DRIED_PLANT, P_QUALITY, QueryProp() und SetProp().

00087 {
00088    age=DRIED_PLANT;
00089    SetProp(P_QUALITY, (QueryProp(P_QUALITY)*qual)/100);
00090 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

int PlantQuality (  ) 

Definiert in Zeile 52 der Datei plant.c.

Benutzt age, P_QUALITY, PLANT_LIFETIME und QueryProp().

Wird benutzt von _query_value().

00059 {
00060    int qual;
00061    if (age+PLANT_LIFETIME < time()) {
00062       qual=negate((time()-age-PLANT_LIFETIME)/360);
00063       return (qual < -100 ? -100 : qual);
00064    }
00065    return QueryProp(P_QUALITY);
00066 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

nomask string QueryCloner (  ) 

Definiert in Zeile 106 der Datei plant.c.

Benutzt cloner.

00107 {  return cloner;   }

nomask int QueryPlantId (  ) 

Definiert in Zeile 103 der Datei plant.c.

Benutzt plantId.

00104 {  return plantId;  }

nomask int SetPlantId ( int  id  ) 

Definiert in Zeile 94 der Datei plant.c.

Benutzt age, cloner, plantId und PLANTMASTER.

00095 {
00096    int res;
00097    if (plantId) return -1;
00098    cloner=0; age=time();
00099    if (catch(cloner=call_other(PLANTMASTER, "CheckPlant", id)) || !cloner) id=-1;
00100    return (plantId=id);
00101 }

string short (  ) 

Definiert in Zeile 41 der Datei plant.c.

Benutzt age, DRIED_PLANT, P_SHORT, PLANT_LIFETIME und QueryProp().

00042 {
00043    string str;
00044    if (!stringp(str=QueryProp(P_SHORT))) return 0;
00045    if (age==DRIED_PLANT)
00046       return str+" (getrocknet).\n";
00047    else if (age+PLANT_LIFETIME<time())
00048       return str+" (verschimmelt).\n";
00049    return str+".\n";
00050 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

int TimeToLive (  ) 

Definiert in Zeile 68 der Datei plant.c.

Benutzt age und PLANT_LIFETIME.

00069 {  return age-time()+PLANT_LIFETIME;  }


Variablen-Dokumentation

int age = time()

Definiert in Zeile 11 der Datei plant.c.

private string cloner [static]

Definiert in Zeile 13 der Datei plant.c.

Wird benutzt von QueryCloner() und SetPlantId().

private int plantId [static]

Definiert in Zeile 12 der Datei plant.c.

Wird benutzt von _query_value(), create(), QueryPlantId() und SetPlantId().

inherit std thing

Definiert in Zeile 3 der Datei plant.c.

Erzeugt am Thu Jun 3 14:40:53 2010 für MorgenGrauen Mudlib von  doxygen 1.6.3