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 "rulesets/Fell.h"
|
|
|
|
|
|
|
|
|
|
#include "rulesets/Entity.h"
|
2004-12-30 20:01:33 +00:00
|
|
|
#include "rulesets/Character.h"
|
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
|
|
|
|
|
|
|
|
#include <Atlas/Objects/Operation/RootOperation.h>
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
|
|
Operation op;
|
|
|
|
|
OpVector res;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
Task * task;
|
|
|
|
|
|
|
|
|
|
if (0) {
|
|
|
|
|
task->TickOperation(op, res);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Entity ent1("1"), ent2("2");
|
2004-12-30 20:01:33 +00:00
|
|
|
Character chr("3");
|
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
|
|
|
Fell fell(chr, ent1, ent2);
|
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
|
|
|
|
|
|
|
|
assert(!fell.obsolete());
|
|
|
|
|
|
|
|
|
|
fell.TickOperation(op, res);
|
|
|
|
|
|
|
|
|
|
fell.irrelevant();
|
|
|
|
|
|
|
|
|
|
assert(fell.obsolete());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|