4
Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
6
This program is free software; you can redistribute it and/or modify it
7
under the terms of the GNU General Public License as published by the
8
Free Software Foundation; either version 2 of the License, or (at your
9
option) any later version.
11
This program is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
You should have received a copy of the GNU General Public License along
17
with this program; if not, write to the Free Software Foundation, Inc.,
18
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
contact: plee-the-bear@gamned.org
22
Please add the tag [Bear] in the subject of your mails.
25
* \file script_director.hpp
26
* \brief An item that plays a script.
27
* \author Julien Jorge
29
#ifndef __BEAR_SCRIPT_DIRECTOR_HPP__
30
#define __BEAR_SCRIPT_DIRECTOR_HPP__
32
#include "engine/base_item.hpp"
33
#include "engine/item_brick/item_with_toggle.hpp"
34
#include "engine/script/script_runner.hpp"
36
#include "generic_items/class_export.hpp"
38
#include "engine/export.hpp"
42
class add_script_actor;
45
* \brief An item that plays a script.
46
* \author Julien Jorge
48
* The custom fields of this class are:
49
* - \a script (string) [required], the script to play,
50
* - any field supported by the parent class.
52
class GENERIC_ITEMS_EXPORT script_director:
53
public engine::item_with_toggle<engine::base_item>,
54
public engine::script_runner
56
DECLARE_BASE_ITEM(script_director);
59
/** \brief The type of the parent class. */
60
typedef engine::item_with_toggle<engine::base_item> super;
63
/** \brief The type of the handles on the items to kill. */
64
typedef universe::derived_item_handle_maker<add_script_actor>::handle_type
70
bool set_string_field( const std::string& name, const std::string& value );
71
bool set_item_list_field
72
( const std::string& name, const std::vector<engine::base_item*>& value );
75
void on_toggle_on(engine::base_item *activator);
76
void progress_on(universe::time_type elapsed_time);
77
void get_dependent_items( std::list<physical_item*>& d ) const;
80
/** \brief The list of items that add an actor. */
81
std::vector<handle_type> m_actors;
83
}; // class script_director
86
#endif // __BEAR_SCRIPT_DIRECTOR_HPP__