# Path: grease/component/base.py
# class ComponentBase(object):
# 	def set_manager(self, manager):
# 	def __del__(self):
# 	def add(self, entity_id, data=None, **data_kw):
# 	def remove(self, entity_id):
# 	def __delitem_(self, entity_id):
# 	def __len__(self):
# 	def __iter__(self):
# 	def __contains__(self, entity_id):
# 	def __getitem__(self, entity_id):
# 
# Path: grease/component/field.py
# class Schema(dict):
# class FieldAccessor(object):
# class Field(object):
# 	def __init__(self, **fields):
# 	def __init__(self, field, entities, attrs=()):
# 			def get(entity):
# 	def __getattr__(self, name):
# 	def __setattr__(self, name, value):
# 	def __setter(self):
# 			def setter(data, name, value):
# 	def __set__(self, value):
# 	def __getitem__(self, entity):
# 	def __contains__(self, entity):
# 	def __repr__(self):
# 	def __bool__(self):
# 	def __iter__(self):
# 	def __match(self, value, op):
# 	def __eq__(self, value):
# 	def __ne__(self, value):
# 	def __gt__(self, value):
# 	def __ge__(self, value):
# 	def __lt__(self, value):
# 	def __le__(self, value):
# 	def _contains(self, values):
# 	def __mutate(self, value, op):
# 	def __iadd__(self, value):
# 	def __isub__(self, value):
# 	def __imul__(self, value):
# 	def __idiv__(self, value):
# 	def __itruediv__(self, value):
# 	def __ifloordiv__(self, value):
# 	def __imod__(self, value):
# 	def __ipow__(self, value):
# 	def __ilshift__(self, value):
# 	def __irshift__(self, value):
# 	def __iand__(self, value):
# 	def __ior__(self, value):
# 	def __ixor__(self, value):
# 	def __init__(self, component, name, type, accessor_factory=FieldAccessor):
# 	def cast(self, value):
# 	def accessor(self, entities=None):
# 
# Path: grease/entity.py
# class ComponentEntitySet(set):
# 	"""Set of entities in a component, can be queried by component fields"""
# 
# 	_component = None
# 
# 	def __init__(self, component, entities=()):
# 		self.__dict__['_component'] = component
# 		super(ComponentEntitySet, self).__init__(entities)
# 	
# 	def __getattr__(self, name):
# 		if self._component is not None and name in self._component.fields:
# 			return self._component.fields[name].accessor(self)
# 		raise AttributeError(name)
# 	
# 	def __setattr__(self, name, value):
# 		if self._component is not None and name in self._component.fields:
# 			self._component.fields[name].accessor(self).__set__(value)
# 		raise AttributeError(name)


from grease.component import base
from grease.component import field
from grease.entity import ComponentEntitySet
			return True
		return False
	
	__delitem__ = remove

	def __repr__(self):
		return '<%s %x of %r>' % (
			self.__class__.__name__, id(self), getattr(self, 'world', None))


class Singleton(Component):
	"""Component that may contain only a single entity"""

	def add(self, entity_id, data=None, **data_kw):
		if entity_id not in self._data:
			self.entity_id_set.clear()
			self._data.clear()
		Component.add(self, entity_id, data, **data_kw)
	
	@property
	def entity(self):
		"""Return the entity in the component, or None if empty"""
		if self._data:
			return self.manager[list(self._data.keys())[0]]
	
class Data(object):

	def __init__(self, fields, entity, **data):
		self.__dict__['_Data__fields'] = fields
		self.__dict__['entity'] = entity

# Path: grease/component/base.py
# class ComponentBase(object):
# 	def set_manager(self, manager):
# 	def __del__(self):
# 	def add(self, entity_id, data=None, **data_kw):
# 	def remove(self, entity_id):
# 	def __delitem_(self, entity_id):
# 	def __len__(self):
# 	def __iter__(self):
# 	def __contains__(self, entity_id):
# 	def __getitem__(self, entity_id):
# 
# Path: grease/component/field.py
# class Schema(dict):
# class FieldAccessor(object):
# class Field(object):
# 	def __init__(self, **fields):
# 	def __init__(self, field, entities, attrs=()):
# 			def get(entity):
# 	def __getattr__(self, name):
# 	def __setattr__(self, name, value):
# 	def __setter(self):
# 			def setter(data, name, value):
# 	def __set__(self, value):
# 	def __getitem__(self, entity):
# 	def __contains__(self, entity):
# 	def __repr__(self):
# 	def __bool__(self):
# 	def __iter__(self):
# 	def __match(self, value, op):
# 	def __eq__(self, value):
# 	def __ne__(self, value):
# 	def __gt__(self, value):
# 	def __ge__(self, value):
# 	def __lt__(self, value):
# 	def __le__(self, value):
# 	def _contains(self, values):
# 	def __mutate(self, value, op):
# 	def __iadd__(self, value):
# 	def __isub__(self, value):
# 	def __imul__(self, value):
# 	def __idiv__(self, value):
# 	def __itruediv__(self, value):
# 	def __ifloordiv__(self, value):
# 	def __imod__(self, value):
# 	def __ipow__(self, value):
# 	def __ilshift__(self, value):
# 	def __irshift__(self, value):
# 	def __iand__(self, value):
# 	def __ior__(self, value):
# 	def __ixor__(self, value):
# 	def __init__(self, component, name, type, accessor_factory=FieldAccessor):
# 	def cast(self, value):
# 	def accessor(self, entities=None):
# 
# Path: grease/entity.py
# class ComponentEntitySet(set):
# 	"""Set of entities in a component, can be queried by component fields"""
# 
# 	_component = None
# 
# 	def __init__(self, component, entities=()):
# 		self.__dict__['_component'] = component
# 		super(ComponentEntitySet, self).__init__(entities)
# 	
# 	def __getattr__(self, name):
# 		if self._component is not None and name in self._component.fields:
# 			return self._component.fields[name].accessor(self)
# 		raise AttributeError(name)
# 	
# 	def __setattr__(self, name, value):
# 		if self._component is not None and name in self._component.fields:
# 			self._component.fields[name].accessor(self).__set__(value)
# 		raise AttributeError(name)


# Path: grease/component/general.py
from grease.component import base
from grease.component import field
from grease.entity import ComponentEntitySet

			return True
		return False
	
	__delitem__ = remove

	def __repr__(self):
		return '<%s %x of %r>' % (
			self.__class__.__name__, id(self), getattr(self, 'world', None))


class Singleton(Component):
	"""Component that may contain only a single entity"""

	def add(self, entity_id, data=None, **data_kw):
		if entity_id not in self._data:
			self.entity_id_set.clear()
			self._data.clear()
		Component.add(self, entity_id, data, **data_kw)
	
	@property
	def entity(self):
		"""Return the entity in the component, or None if empty"""
		if self._data:
			return self.manager[list(self._data.keys())[0]]
	
class Data(object):

	def __init__(self, fields, entity, **data):
		self.__dict__['_Data__fields'] = fields
		self.__dict__['entity'] = entity

		for field in list(fields.values()):