mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
* rulesets/Script.cpp: Document the script interface. * rulesets/Task.h: Modify task interface so tasks now expect the operation that initiated the task to be passed in to an init function. * rulesets/Combat.h, rulesets/Combat.cpp: Modify the combat task methods to match the interface changes. * rulesets/Character.cpp: Modify Combat use to take account of interface changes. Prototype using script based combat. * rulesets/TaskScript.h, rulesets/TaskScript.cpp: Implement passing the initialising op through to the script using the standard scripp operation handling functions. * rulesets/mason/world/tasks/Combat.py: Add handler for Attack operation, which should now be passed in at init time.
35 lines
1 KiB
C++
35 lines
1 KiB
C++
// This file may be redistributed and modified only under the terms of
|
|
// the GNU General Public License (See COPYING for details).
|
|
// Copyright (C) 2001 Alistair Riddoch
|
|
|
|
#include "Script.h"
|
|
|
|
Script::Script()
|
|
{
|
|
}
|
|
|
|
Script::~Script()
|
|
{
|
|
}
|
|
|
|
// FIXME Return value of operation should be an int with different
|
|
// return values for failure vs. not accepted. 0 for success obviously
|
|
|
|
/// \brief Pass an operation to the script for processing
|
|
///
|
|
/// @param type The string representing the type of the operation
|
|
/// @param op The operation to be passed
|
|
/// @param res The result of the operation is returned here
|
|
/// @return true if operation was accepted, false if it was not handled
|
|
/// or an error occured.
|
|
bool Script::operation(const std::string & opname,
|
|
const Atlas::Objects::Operation::RootOperation & op,
|
|
OpVector & res,
|
|
const Atlas::Objects::Operation::RootOperation * sub_op)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
void Script::hook(const std::string &, Entity *)
|
|
{
|
|
}
|