2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
// This file may be redistributed and modified only under the terms of
|
|
|
|
|
// the GNU General Public License (See COPYING for details).
|
|
|
|
|
// Copyright (C) 2004 Alistair Riddoch
|
|
|
|
|
|
|
|
|
|
#include "Task.h"
|
|
|
|
|
|
2004-12-30 20:01:33 +00:00
|
|
|
/// \brief Task constructor for classes which inherit from Task
|
|
|
|
|
Task::Task(Character & chr) : m_obsolete(false), m_character(chr)
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-30 20:01:33 +00:00
|
|
|
/// \brief Task destructor
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
Task::~Task()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-30 20:01:33 +00:00
|
|
|
/// \brief Set the obsolete flag indicating that this task is obsolete
|
|
|
|
|
///
|
|
|
|
|
/// The task should be checked to see if it is irrelevant before any
|
|
|
|
|
/// processing is passed to it. A typical example is the Task may
|
|
|
|
|
/// contain references to entities which are deleted. irrelevant() could
|
|
|
|
|
/// be connected to the destroyed signal of the entities, so that it
|
|
|
|
|
/// never de-references the pointers to deleted entities.
|
2004-12-28 Al Riddoch <alriddoch@zepler.org>
* common/OOGThing.cpp, common/Property.cpp, common/Property.h,
common/Property_impl.h, common/inheritance.h, common/operations.cpp,
rulesets/World.cpp: Update some comments.
* rulesets/Task.h, rulesets/Task.cpp, tests/Tasktest.cpp,
rulesets/Fell.h, rulesets/Fell.cpp: New Task interface for
tasks which take a while to complete. Sample implentation provided
in the form of a Fell task for felling trees.
* rulesets/Character.cpp, rulesets/Character.h: Try out Task
implementation with Fell.
2004-12-28 02:14:17 +00:00
|
|
|
void Task::irrelevant()
|
|
|
|
|
{
|
|
|
|
|
m_obsolete = true;
|
|
|
|
|
}
|