2014-09-13 10:34:30 +02:00
|
|
|
/*
|
|
|
|
|
Copyright (C) 2014 Erik Ogenvik
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef DOMAINPROPERTY_H_
|
|
|
|
|
#define DOMAINPROPERTY_H_
|
|
|
|
|
|
|
|
|
|
#include "common/Property.h"
|
2015-04-28 20:56:15 +02:00
|
|
|
#include "common/PropertyInstanceState.h"
|
2014-09-13 10:34:30 +02:00
|
|
|
|
|
|
|
|
class Domain;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Specifies that an entity contains a "Domain".
|
|
|
|
|
*
|
|
|
|
|
* This makes the entity responsible for physics and sight checking, effectively giving the entity
|
|
|
|
|
* it's own space.
|
2014-09-24 22:00:54 +02:00
|
|
|
* Normally you wouldn't use nested domains, since the effects (currently) are undefined.
|
|
|
|
|
*
|
|
|
|
|
* The data defines the kind of domain. The available options are:
|
|
|
|
|
* * void: no movement or sight allowed
|
|
|
|
|
* * physical: movement and sights behave like in the real world
|
2014-09-13 10:34:30 +02:00
|
|
|
*/
|
2014-09-24 22:00:54 +02:00
|
|
|
class DomainProperty : public Property<std::string>
|
2014-09-13 10:34:30 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
explicit DomainProperty();
|
|
|
|
|
explicit DomainProperty(const DomainProperty& rhs);
|
|
|
|
|
|
2015-04-28 20:56:15 +02:00
|
|
|
virtual void install(LocatedEntity *, const std::string &);
|
2014-09-13 10:34:30 +02:00
|
|
|
virtual void remove(LocatedEntity *, const std::string &);
|
|
|
|
|
virtual DomainProperty * copy() const;
|
|
|
|
|
|
|
|
|
|
virtual void apply(LocatedEntity *);
|
|
|
|
|
|
2015-04-28 20:56:15 +02:00
|
|
|
Domain* getDomain(const LocatedEntity *) const;
|
2014-09-13 10:34:30 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
2015-04-28 20:56:15 +02:00
|
|
|
static PropertyInstanceState<Domain> sInstanceState;
|
2014-09-13 10:34:30 +02:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif /* DOMAINPROPERTY_H_ */
|