Autor Beitrag
Zombimode
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98, Win XP

BeitragVerfasst: So 19.12.04 16:58 
vielsagender Titel, nicht?
sorry, mir ist nichts besseres eingefallen...

ich hab mal wieder ein Problem mit der Delphi Syntax

Ich will fragen, ob in einem ennumeratet type das eine oder das andere nicht drin steht, also tippe ich:
ausblenden Delphi-Quelltext
1:
if evil or vevil not in spieler.state then					


funzt nicht, hab ein wenig rumprobiert, logisch erschien mir:
ausblenden Delphi-Quelltext
1:
if not evil or not vevil in spieler.state then					


geht leider auch nicht

*verzweifelt ist*

Wie schreibt man sowas richtig?
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 19.12.04 17:10 
ausblenden Delphi-Quelltext
1:
if not ((evil in spieler.state) and (vevil in spieler.state)) then					


//edit: achsoo.. evil ist auch Teil der Enumeration.. :oops:

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!


Zuletzt bearbeitet von Motzi am So 19.12.04 17:22, insgesamt 1-mal bearbeitet
Benutzername
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 210

Win XP Pro
Delphi 7 PE, D2005 Prof. SSL
BeitragVerfasst: So 19.12.04 17:11 
ausblenden Delphi-Quelltext
1:
if (not evil in spieler.state) or (not vevil in Spieler.State)					


Ungetestet, müsste aber gehen :-)
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 19.12.04 17:12 
Ich weiß zwar nicht, was Du damit bezwecken willst, aber probiers mal damit:
ausblenden Delphi-Quelltext
1:
if (evil in spieler.state) or (not (vevil in spieler.state)) then					

//edit: *medaille "slowest user of the year 2004" umhäng*

_________________
JSXGraph
Zombimode Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98, Win XP

BeitragVerfasst: So 19.12.04 17:27 
Alles in interessante Vorschläge :D

hab nen Kumpel zur Rate gezogen und sind gemeinsam auf
ausblenden Delphi-Quelltext
1:
if not (evil in spieler.state) or not (vevil in spieler.state) then					

gekommen, und das geht

danke trotzdem für die antworten

was ich damit bezwecken will:
Ein Schwert fügt seinem Träger nach jedem Kampf Schaden zu, wenn dieser nicht so böse ist wie das Schwert. Wenn eine Figur böse ist, dann beinhaltet der Mengentyp state der Figur den Wert evil, wenn die Figur abgrundtief böse ist eben vevil (steht für very evil). Und bei diesem Schwert muss halt nach jedem Kampf geguckt werden, ob der Spieler böse ist, und wenn das nicht der Fall ist (also weder evil noch vevil in spieler.state stehen), nimmt der Spieler Schaden.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 19.12.04 17:32 
//Edit: wegen Schwachsinns gelöscht.. :? :roll:

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!