cyphesis/tests/Tasktest.cpp
Al Riddoch 901cdbff8d 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

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;
}