'use strict';

var config = require('./__config');
var run = require('oyo/run')(config, {isDebug: 1});
var isDebug = run.isDebug;

var Animal;
var Mammal;

var prepare = function(){
	var fac = require('../../lib');

	// Wrap as Fac-Model. Only for the root object,
	// not the descendants, neat!
	Animal = fac({
		name: 'Animal',
		age: 1,
		colors: ['white', 'black'],
		parts: {body: 1},

		string: String,
		boolean: Boolean,
		number: Number,
		array: Array,
		object: Object,
		date: Date,
		regExp: RegExp,
		error: Error,

		str: '',
		bool: true,
		num: 1,
		arr: [],
		obj: {},
		dat: new Date(),
		reg: /test/,

		init: function(){

			// The init function is not necessary in Fac.
			// If you wanna do something when .new() is called,
			// write it in init. If not, remove init.

			isDebug && console.log('Animal init done...', this.name);
		},

		sayHi: function(){
			return 'Hi from ' + this.name + ' ' + this.age;
		},

		f0: function(){},
		f1: function(){},
		f2: function(){},
		f3: function(){},
		f4: function(){},
		f5: function(){},
		f6: function(){},
		f7: function(){},
		f8: function(){},
		f9: function(){},

		f10: function(){},
		f11: function(){},
		f12: function(){},
		f13: function(){},
		f14: function(){},
		f15: function(){},
		f16: function(){},
		f17: function(){},
		f18: function(){},
		f19: function(){},

		f20: function(){},
		f21: function(){},
		f22: function(){},
		f23: function(){},
		f24: function(){},
		f25: function(){},
		f26: function(){},
		f27: function(){},
		f28: function(){},
		f29: function(){}
	});
}();

var tester = function(done, count){

	var tobe = Animal.new({name: 'Tobe', age: 4});

	done(count);
};

run(tester);
