mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
* 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.
45 lines
726 B
C++
45 lines
726 B
C++
// 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"
|
|
|
|
#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");
|
|
|
|
{
|
|
Fell fell(ent1, ent2);
|
|
|
|
assert(!fell.obsolete());
|
|
|
|
fell.TickOperation(op, res);
|
|
|
|
fell.irrelevant();
|
|
|
|
assert(fell.obsolete());
|
|
}
|
|
|
|
return ret;
|
|
}
|