 
 {EventEmitter} = require "./EventEmitter"
 
+CounterKey = "_ObjectCounter"
 DefinedPropertiesKey = "_DefinedPropertiesKey"
 DefinedPropertiesValuesKey = "_DefinedPropertiesValuesKey"
+
 
 class exports.BaseClass extends EventEmitter
 

					if @constructor[DefinedPropertiesKey].exportable isnt false
						@[k] = v


	#################################################################
	# Base constructor method

	constructor: (options) ->

		super

		@[DefinedPropertiesValuesKey] = {}

		options ?= {}

		_.map @constructor[DefinedPropertiesKey], (descriptor, name) =>
			@[name] = Utils.valueOrDefault options[name], @_getPropertyDefaultValue name



		Object.defineProperty @prototype, propertyName, descriptor
		Object.__

	@SimpleProperty = (name, fallback, exportable=true) ->
		exportable: exportable
		default: fallback
		get: ->  @_getPropertyValue name
		set: (value) -> @_setPropertyValue name, value

	_setPropertyValue: (k, v) =>
		@[DefinedPropertiesValuesKey][k] = v
