File: Quake3MapFormat.h

package info (click to toggle)
darkradiant 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,080 kB
  • sloc: cpp: 264,743; ansic: 10,659; python: 1,852; xml: 1,650; sh: 92; makefile: 21
file content (65 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once

#include "imapformat.h"

namespace map
{

class Quake3MapFormatBase :
	public MapFormat
{
public:
	// RegisterableModule implementation
	virtual const StringSet& getDependencies() const override;
	virtual void initialiseModule(const IApplicationContext& ctx) override;
	virtual void shutdownModule() override;

    // Map reader is shared by Q3 and Q3 alternate
	virtual IMapReaderPtr getMapReader(IMapImportFilter& filter) const override;

	virtual bool allowInfoFileCreation() const override;
	virtual bool canLoad(std::istream& stream) const override;

protected:
    virtual std::shared_ptr<Quake3MapFormatBase> getSharedToThis() = 0;
};

class Quake3MapFormat :
	public Quake3MapFormatBase,
	public std::enable_shared_from_this<Quake3MapFormat>
{
public:
	// RegisterableModule implementation
	virtual const std::string& getName() const override;

	virtual const std::string& getMapFormatName() const override;
	virtual const std::string& getGameType() const override;
	virtual IMapWriterPtr getMapWriter() const override;

protected:
    virtual std::shared_ptr<Quake3MapFormatBase> getSharedToThis() override
    {
        return shared_from_this();
    }
};

class Quake3AlternateMapFormat :
    public Quake3MapFormatBase,
    public std::enable_shared_from_this<Quake3AlternateMapFormat>
{
public:
    // RegisterableModule implementation
    virtual const std::string& getName() const override;

    virtual const std::string& getMapFormatName() const override;
    virtual const std::string& getGameType() const override;
    virtual IMapWriterPtr getMapWriter() const override;

protected:
    virtual std::shared_ptr<Quake3MapFormatBase> getSharedToThis() override
    {
        return shared_from_this();
    }
};

} // namespace