add a followviewport bool to uncontrolled_sounds, so that the c1 music doesn't get...
[openc2e.git] / Scriptorium.h
blob5445d2b22fedabde5d404c1e41e9b0745f06e8ab
1 /*
2 * Scriptorium.h
3 * openc2e
5 * Created by Alyssa Milburn on Wed 10 Nov 2004.
6 * Copyright (c) 2004-2006 Alyssa Milburn. All rights reserved.
7 * Copyright (c) 2005 Bryan Donlan. All rights reserved.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
21 #ifndef _SCRIPTORIUM_H
22 #define _SCRIPTORIUM_H
24 #include "openc2e.h"
25 #include <boost/shared_ptr.hpp>
26 using boost::shared_ptr;
27 #include <map>
29 class script;
31 class Scriptorium {
32 protected:
33 FRIEND_SERIALIZE(Scriptorium);
34 // unsigned int = combined family/genus/species
35 // unsigned short = event id
36 std::map<unsigned int, std::map<unsigned short, shared_ptr<script> > > scripts;
38 std::map<unsigned short, shared_ptr<script> > &getScripts(unsigned int value) { return scripts[value]; }
39 unsigned int calculateValue(unsigned char family, unsigned char genus, unsigned short species);
41 public:
42 void addScript(unsigned char family, unsigned char genus, unsigned short species, unsigned short event, shared_ptr<script> s);
43 void delScript(unsigned char family, unsigned char genus, unsigned short species, unsigned short event);
44 shared_ptr<script> getScript(unsigned char family, unsigned char genus, unsigned short species, unsigned short event);
47 #endif
48 /* vim: set noet: */