1 /* bzflag
2  * Copyright (c) 1993-2021 Tim Riker
3  *
4  * This package is free software;  you can redistribute it and/or
5  * modify it under the terms of the license found in the file
6  * named COPYING that should have accompanied this file.
7  *
8  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11  */
12 #ifndef __WORLDFILEOBJECT_H__
13 #define __WORLDFILEOBJECT_H__
14 
15 // Before everything
16 #include "common.h"
17 
18 // system headers
19 #include <iostream>
20 #include <vector>
21 #include <string>
22 
23 
24 class WorldInfo;
25 class GroupDefinition;
26 
27 
28 class WorldFileObject
29 {
30 public:
31     WorldFileObject();
~WorldFileObject()32     virtual ~WorldFileObject() {}
33 
34     virtual bool read(const char *cmd, std::istream&);
35 
usesManager()36     virtual bool usesManager()
37     {
38         return false;
39     }
usesGroupDef()40     virtual bool usesGroupDef()
41     {
42         return true;
43     }
44     virtual void writeToWorld(WorldInfo*) const;
45     virtual void writeToManager() const;
46     virtual void writeToGroupDef(GroupDefinition*) const;
47 
48     virtual int getLineCount() const;
49 
50 protected:
51     std::string name;
52     int lines;
53 };
54 
55 void emptyWorldFileObjectList(std::vector<WorldFileObject*>& wlist);
56 
57 #endif  /* __WORLDFILEOBJECT_H__ */
58 
59 // Local variables: ***
60 // mode: C++ ***
61 // tab-width: 4***
62 // c-basic-offset: 4 ***
63 // indent-tabs-mode: nil ***
64 // End: ***
65 // ex: shiftwidth=4 tabstop=4
66