2005-08-27 23:26:56 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) != 2:
|
|
|
|
|
print "usage: " + sys.argv[0] + " <opname>"
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
opname = sys.argv[1].lower()
|
|
|
|
|
opnamecap = opname.capitalize()
|
|
|
|
|
opnameup = opname.upper()
|
|
|
|
|
|
|
|
|
|
outfile = open('common/' + opnamecap + '.h', 'w')
|
|
|
|
|
|
|
|
|
|
outfile.write("""// This file may be redistributed and modified only under the terms of
|
|
|
|
|
// the GNU General Public License (See COPYING for details).
|
|
|
|
|
// Copyright (C) 2005 Alistair Riddoch
|
|
|
|
|
|
|
|
|
|
#ifndef COMMON_%s_H
|
|
|
|
|
#define COMMON_%s_H
|
|
|
|
|
|
2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/Add.h, common/Burn.h, common/Chop.h, common/Connect.h,
common/Cut.h, common/Delve.h, common/Dig.h, common/Eat.h,
common/Monitor.h, common/Mow.h, common/Nourish.h, common/Setup.h,
common/Tick.h, common/Unseen.h, common/Update.h,
* common/operations.cpp, scripts/gen_op.py:
Try a new much simpler way of handling custom ops.
* common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h:
Remove obsolete old template for custom ops.
* common/custom.cpp: Install factories in a different way for all
the custom op types.
2005-09-12 00:31:15 +00:00
|
|
|
#include <Atlas/Objects/Generic.h>
|
2005-08-27 23:26:56 +00:00
|
|
|
|
|
|
|
|
namespace Atlas { namespace Objects { namespace Operation {
|
|
|
|
|
|
2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/Add.h, common/Burn.h, common/Chop.h, common/Connect.h,
common/Cut.h, common/Delve.h, common/Dig.h, common/Eat.h,
common/Monitor.h, common/Mow.h, common/Nourish.h, common/Setup.h,
common/Tick.h, common/Unseen.h, common/Update.h,
* common/operations.cpp, scripts/gen_op.py:
Try a new much simpler way of handling custom ops.
* common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h:
Remove obsolete old template for custom ops.
* common/custom.cpp: Install factories in a different way for all
the custom op types.
2005-09-12 00:31:15 +00:00
|
|
|
extern int %s_NO;
|
|
|
|
|
|
|
|
|
|
class %s : public Generic
|
|
|
|
|
{
|
2005-08-27 23:26:56 +00:00
|
|
|
public:
|
2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/Add.h, common/Burn.h, common/Chop.h, common/Connect.h,
common/Cut.h, common/Delve.h, common/Dig.h, common/Eat.h,
common/Monitor.h, common/Mow.h, common/Nourish.h, common/Setup.h,
common/Tick.h, common/Unseen.h, common/Update.h,
* common/operations.cpp, scripts/gen_op.py:
Try a new much simpler way of handling custom ops.
* common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h:
Remove obsolete old template for custom ops.
* common/custom.cpp: Install factories in a different way for all
the custom op types.
2005-09-12 00:31:15 +00:00
|
|
|
%s() {
|
|
|
|
|
(*this)->setType("%s", %s_NO);
|
|
|
|
|
}
|
2005-08-27 23:26:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} } }
|
|
|
|
|
|
|
|
|
|
#endif // COMMON_%s_H
|
2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/Add.h, common/Burn.h, common/Chop.h, common/Connect.h,
common/Cut.h, common/Delve.h, common/Dig.h, common/Eat.h,
common/Monitor.h, common/Mow.h, common/Nourish.h, common/Setup.h,
common/Tick.h, common/Unseen.h, common/Update.h,
* common/operations.cpp, scripts/gen_op.py:
Try a new much simpler way of handling custom ops.
* common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h:
Remove obsolete old template for custom ops.
* common/custom.cpp: Install factories in a different way for all
the custom op types.
2005-09-12 00:31:15 +00:00
|
|
|
""" % (opnameup, opnameup, opnameup, opnamecap, opnamecap, opname, opnameup, opnameup))
|
2005-08-27 23:26:56 +00:00
|
|
|
outfile.close()
|