TrinityCore
Loading...
Searching...
No Matches
ScriptActions.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2 of the License, or (at your
7
* option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#include "
ScriptActions.h
"
19
#include "
GameTime.h
"
20
21
namespace
Scripting::v2
22
{
23
ActionBase::ActionBase
() : _isReady(false)
24
{
25
}
26
27
ActionBase::ActionBase
(
ActionBase
const
& other) =
default
;
28
ActionBase::ActionBase
(
ActionBase
&& other)
noexcept
=
default
;
29
ActionBase
&
ActionBase::operator=
(
ActionBase
const
& other) =
default
;
30
ActionBase
&
ActionBase::operator=
(
ActionBase
&& other)
noexcept
=
default
;
31
32
ActionBase::~ActionBase
() =
default
;
33
34
bool
ActionBase::IsReady
() const noexcept
35
{
36
return
_isReady
;
37
}
38
39
void
ActionBase::MarkCompleted
() noexcept
40
{
41
_isReady
=
true
;
42
}
43
44
void
MarkActionCompleted
(
ActionBase
& action)
45
{
46
action.
MarkCompleted
();
47
}
48
49
WaitAction::WaitAction
(
TimePoint
waitEnd) : _waitEnd(waitEnd)
50
{
51
}
52
53
bool
WaitAction::IsReady
() const noexcept
54
{
55
return
_waitEnd
<=
GameTime::Now
();
56
}
57
}
TimePoint
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition
Duration.h:40
GameTime.h
ScriptActions.h
Scripting::v2::ActionBase
Definition
ScriptActions.h:33
Scripting::v2::ActionBase::MarkCompleted
void MarkCompleted() noexcept
Definition
ScriptActions.cpp:39
Scripting::v2::ActionBase::ActionBase
ActionBase()
Definition
ScriptActions.cpp:23
Scripting::v2::ActionBase::_isReady
bool _isReady
Definition
ScriptActions.h:49
Scripting::v2::ActionBase::operator=
ActionBase & operator=(ActionBase const &other)
Scripting::v2::ActionBase::~ActionBase
virtual ~ActionBase()
Scripting::v2::ActionBase::IsReady
virtual bool IsReady() const noexcept
Definition
ScriptActions.cpp:34
Scripting::v2::WaitAction::_waitEnd
TimePoint _waitEnd
Definition
ScriptActions.h:60
Scripting::v2::WaitAction::IsReady
bool IsReady() const noexcept override
Definition
ScriptActions.cpp:53
Scripting::v2::WaitAction::WaitAction
WaitAction(TimePoint waitEnd)
Definition
ScriptActions.cpp:49
GameTime::Now
TimePoint Now()
Current chrono steady_clock time point.
Definition
GameTime.cpp:67
Scripting::v2
Definition
SmartScript.h:37
Scripting::v2::MarkActionCompleted
void MarkActionCompleted(ActionBase &action)
Definition
ScriptActions.cpp:44
server
game
Scripting
v2
ScriptActions.cpp
Generated on Sun May 10 2026 02:09:01 for TrinityCore by
1.9.8