Crossfire Server, Trunk
1.75.0
CFTimeOfDay.py
Go to the documentation of this file.
1
import
Crossfire
2
3
class
TimeOfDay
:
4
def
__init__
(self):
5
self.
now
= Crossfire.GetTime()
6
self.
current
= [Crossfire.GetMonthName(self.
now
[1]),Crossfire.GetWeekdayName(self.
now
[5]),Crossfire.GetSeasonName(self.
now
[7]),Crossfire.GetPeriodofdayName(self.
now
[8])]
7
8
def
matchAny
(self,what):
9
if
isinstance(what,list):
10
return
bool(
set
(what) &
set
(self.
current
))
11
else
:
12
return
bool(
set
([what]) & set (self.
current
))
13
14
def
matchAll
(self,what):
15
if
isinstance(what,list):
16
return
bool(
not
(
set
(what) -
set
(self.
current
)))
17
else
:
18
return
bool(
not
(
set
([what]) - set (self.
current
)))
19
def
log
(self):
20
Crossfire.Log(Crossfire.LogDebug,
"current time is seen as %s"
%self.
current
)
CFTimeOfDay.TimeOfDay.matchAny
def matchAny(self, what)
Definition:
CFTimeOfDay.py:8
CFTimeOfDay.TimeOfDay.current
current
Definition:
CFTimeOfDay.py:6
CFTimeOfDay.TimeOfDay.__init__
def __init__(self)
Definition:
CFTimeOfDay.py:4
CFTimeOfDay.TimeOfDay.now
now
Definition:
CFTimeOfDay.py:5
CFTimeOfDay.TimeOfDay.matchAll
def matchAll(self, what)
Definition:
CFTimeOfDay.py:14
CFTimeOfDay.TimeOfDay.log
def log(self)
Definition:
CFTimeOfDay.py:19
CFTimeOfDay.TimeOfDay
Definition:
CFTimeOfDay.py:3
set
*envar *is the environment if one that can also be used as an override If both the flag and the envar are set
Definition:
server-directories.txt:12
crossfire-crossfire-maps
python
CFTimeOfDay.py
Generated on Tue Jun 10 2025 17:35:31 for Crossfire Server, Trunk by
1.8.17