Initial porting to the new component API.
[tagua/yd.git] / src / core / variant.h
blob558836f790959a0a1745629c4791ecd0dec7dee6
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef CORE__VARIANT_H
12 #define CORE__VARIANT_H
14 #include "repository.h"
16 /**
17 * @brief A Variant instance represents a game supported in Tagua.
19 class TAGUA_EXPORT Variant {
20 QString m_name;
21 QString m_proxy;
22 bool m_hidden;
23 Repository m_repo;
24 public:
25 Variant(const QString& name, const QString& proxy = QString(), bool hidden = false);
27 QString name() const;
29 QString proxy() const;
31 bool hidden() const;
33 const Repository* repository() const;
34 Repository* repository();
37 template <typename Interface>
38 Interface* requestComponent(Variant* var, const QString& component) {
39 return requestInterface<Interface>(var->repository()->getComponent(component));
42 #endif // CORE__VARIANT_H