function SeaObjects(obj, deck, direct, kind, shots)
{
	var th = this
//--------------------------------//

	var take_cells = new Array()
	var hits = new Array()
	var anims = new Array()
	var mouse = false
	// hits.push(1)
	var _visual_ship;
	init()
// GETTERS
	// Получение занимаемых клеток
	this.getTakes = function() {
		return take_cells
	}

	this.getHits = function(){
		return hits
	}
	// Получение имени объекта
	this.getName = function(){
		return obj
	}
	// Получение разновидности объекта
	this.getKind = function(){
		return kind
	}

	// Получение визуального объекта
	this.getVisual = function() {
		return _visual_ship
	}

	// Получение ориентации
	this.getDirection = function() {
		return _visual_ship.getDirect()
	}

	// Получение количества занимаемых ячеек
	this.getNumDecks = function() {
		return deck
	}
	// Изменение ориентации
	this.changeDir = function(){
		_visual_ship.changeDir()
		if(obj == "dinamite"){
			changeDirection(_visual_ship.getDirect())
		}
	}
	// Изменение прозрачности
	this.setAlpha = function(v){
		_visual_ship.setAlpha(v)
	}

	this.setVisible = function(name){
		_visual_ship.setGraphics(jsons["JSON1"], name, true)
	}

	this.clearVisible = function(){
		_visual_ship.clearGraphics()
	}

	this.dontMouseTouch = function(){
		mouse = true
	}

	this.hits = new Array()
	// Ранение
	this.setHit = function(v){
		this.hits.push(v)
		hits.push(v)
		if(obj == "mine"){
			_visual_ship.clearGraphics()
			_visual_ship.setGraphics(jsons["JSON1"], "mine", true)
		}else if(obj == "ship"){
			var anim = new createjs.Sprite(jsons["JSON4"], "fire")
			anim.play()
			var set_coor = false

			if(deck == 1){
				_visual_ship.setGraphics("1ship_black")
				if(!set_coor)
					setCoor(anim, -49, -111)
				set_coor = true
			}if(deck == 2){
				if(indexOf(hits, 0) != -1)
					if(this.getDirection() == "goriz"){
						_visual_ship.setGraphics("1ship_black1")
						if(v == 0){
							// console.log("v0")
							setCoor(anim, -53, -82)
						}
						set_coor = true
					}else{
						_visual_ship.setGraphics("1ship_black2")
						if(v == 0){
							setCoor(anim, -50, -77)
						}
						set_coor = true
					}
				if(indexOf(hits, 1) != -1)
					if(this.getDirection() == "goriz"){
						_visual_ship.setGraphics("1ship_black2")
						if(v == 1){
							// console.log("v1")
							setCoor(anim, -24, -110)
						}
						set_coor = true
					}else{
						_visual_ship.setGraphics("1ship_black1")
						if(v == 1){
							// console.log("v1_vert")
							setCoor(anim, -24, -50)
						}
						set_coor = true
					}
			}else if(deck == 3){
				if(indexOf(hits, 0) != -1)
					if(this.getDirection() == "goriz"){
						_visual_ship.setGraphics("3ship_black1")
					}else{
						_visual_ship.setGraphics("3ship_black3")
					}
				if(indexOf(hits, 1) != -1){
						_visual_ship.setGraphics("3ship_black2")
					}
				if(indexOf(hits, 2) != -1)
					if(this.getDirection() == "goriz")
						_visual_ship.setGraphics("3ship_black3")
					else
						_visual_ship.setGraphics("3ship_black1")
				if(indexOf(hits, 0) != -1 && indexOf(hits, 1) != -1)
					if(this.getDirection() == "goriz")
						_visual_ship.setGraphics("3ship_black1-2")
					else
						_visual_ship.setGraphics("3ship_black2-3")
				if(indexOf(hits, 1) != -1 && indexOf(hits, 2) != -1)
					if(this.getDirection() == "goriz")
						_visual_ship.setGraphics("3ship_black2-3")
					else
						_visual_ship.setGraphics("3ship_black1-2")
				if(indexOf(hits, 0) != -1 && indexOf(hits, 2) != -1)
					_visual_ship.setGraphics("3ship_black1-3")
			}
			if(hits.length == deck)
				_visual_ship.setGraphics(deck + "ship_black")

			if(deck == 3){
				if(v == 0)
					if(this.getDirection() == "goriz"){						
						if(!set_coor)
							setCoor(anim, -26, -12-34)
						set_coor = true
					}else{
						if(!set_coor)
							setCoor(anim, -43, -29)
						set_coor = true
					}
				if(v == 1)
					if(this.getDirection() == "goriz"){
						if(!set_coor)
							setCoor(anim, -13, -79)
						set_coor = true
					}else{
						if(!set_coor)
							setCoor(anim, -12, -13)
						set_coor = true
					}
				if(v == 2)
					if(this.getDirection() == "goriz"){
						if(!set_coor)
							setCoor(anim, 21, -98)
						set_coor = true
					}else{
						if(!set_coor)
							setCoor(anim, 21, 22)
						set_coor = true
					}
			}

			anim.cache(0, 0, 176/__koefDisplay, 176/__koefDisplay)
			t_addToTicker(function(){anim.updateCache()})

			anims.push(anim)
			for(var a=0; a<anims.length; a++){
				_visual_ship.addChild(anims[a])
				// dragAndDrop(anims[a])
				// anims[a].mouseEnabled = true
				_visual_ship.mouseChildren = true			
			}
			// console.log("booooooom")
		}
	}

// SETTERS
	this.take_c = take_cells
	this.setTakes = function(i, j, add) {
		var m = new Array()
		if(i == -1 && !add){
			take_cells = m
			this.take_c = m
			// return
		}
		if(add){
			take_cells.push({i:i, j:j})
			this.take_c = take_cells
			return
		}
		var o;
		if(_visual_ship[0])
			o = _visual_ship[0]
		else
			o = _visual_ship
		for(var a = 0; a<deck; a++){
			if(o.getDirect() == "goriz") {
				var cell = {i:i, j:j+a}
				m.push(cell)
			}
			if(o.getDirect() == "vert") {
				var cell = {i:i+a, j:j}
				m.push(cell)
			}
		}
		take_cells = m
		this.take_c = m
	}

	this.setMouseEnabled = function(v){
		if(obj == "part_ship" || obj == "rock" || obj == "debris" || obj == "empty" || obj == "chest" || (obj == "mine" && shots) || mouse)
			return
		else
			_visual_ship.mouseEnabled = v
	}

// PRIVATE //
	function init(){
		if(obj == "debris"){
			_visual_ship = new Mine(th, "debris", kind)
			_visual_ship.setStartCoor(field_params.startX_debris_1, field_params.startY_debris_1)
			_visual_ship.mouseEnabled = false
		}
		if(obj == "empty"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON1"], "miss")	
			_visual_ship.setStartCoor(field_params.startX_empty, field_params.startY_empty)	
			_visual_ship.mouseEnabled = false	
		}
		if(obj == "ship")
			_visual_ship = new Ship(deck, direct, th)
		if(obj == "mine"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON4"], "floating-bomb-anim", true)
			if(shots){
				_visual_ship.clearGraphics()
				_visual_ship.setGraphics(jsons["JSON2"], "mine", true)
				_visual_ship.mouseEnabled = false	
			}
		}
		if(obj == "chest"){
			_visual_ship = new Mine(th, "chest_on")
			if(shots){
				_visual_ship.setGraphics(jsons["JSON1"], "chest_off", true)
				_visual_ship.mouseEnabled = false	
			}
			_visual_ship.setStartCoor(field_params.startX_chest, field_params.startY_chest)
		}
		if(obj == "anim-target"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)
			_visual_ship.setStartCoor(field_params.startX_terget, field_params.startY_terget)
		}
		if(obj == "bomb"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 1) + (field_params.dx * __koefDisplay * 0), (-field_params.dy * __koefDisplay * 1) + (field_params.dy * __koefDisplay * 0))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 1) + (field_params.dx * __koefDisplay * 1), (-field_params.dy * __koefDisplay * 1) + (field_params.dy * __koefDisplay * 1))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 0) + (field_params.dx * __koefDisplay * 1), (-field_params.dy * __koefDisplay * 0) + (field_params.dy * __koefDisplay * 1))
			
			_visual_ship.setStartCoor(field_params.startX_terget, field_params.startY_terget)
		}
		if(obj == "dinamite"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 2) + (field_params.dx * __koefDisplay * 0), (-field_params.dy * __koefDisplay * 2) + (field_params.dy * __koefDisplay * 0))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 1) + (field_params.dx * __koefDisplay * 0), (-field_params.dy * __koefDisplay * 1) + (field_params.dy * __koefDisplay * 0))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)
			
			_visual_ship.setStartCoor(field_params.startX_terget, field_params.startY_terget)
		}
		if(obj == "periskop"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON1"], "submarine_area1", true)
			
			_visual_ship.setStartCoor(field_params.startX_per, field_params.startY_per)
		}
		if(obj == "torpedo"){
			var ob = new Mine(th)
			ob.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 0) + (field_params.dx * __koefDisplay * (-1)), (-field_params.dy * __koefDisplay * 0) + (field_params.dy * __koefDisplay * (-1)))
			ob.setCell( -1, 0)
			var ob1 = new Mine(th)
			ob1.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 1) + (field_params.dx * __koefDisplay * 0), (-field_params.dy * __koefDisplay * 1) + (field_params.dy * __koefDisplay * 0))
			ob1.setGraphics(jsons["JSON4"], "anim-target", true)
			ob1.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * (-1)) + (field_params.dx * __koefDisplay * 0), (-field_params.dy * __koefDisplay * (-1)) + (field_params.dy * __koefDisplay * 0))
			ob1.setCell(0, -1)
			ob1.setCell(0, 0)
			ob1.setCell(0, 1)
			var ob2 = new Mine(th)
			ob2.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * __koefDisplay * 0) + (field_params.dx * __koefDisplay * 1), (-field_params.dy * __koefDisplay * 0) + (field_params.dy * __koefDisplay * 1))
			ob2.setCell(1, 0)
			// _visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)

			ob1.setListener(ob, ob2)
			ob.setListener(ob1, ob2)
			ob2.setListener(ob, ob1)

			_visual_ship = new Array()
			_visual_ship.push(ob)
			_visual_ship.push(ob1)
			_visual_ship.push(ob2)
			for(var a=0; a<_visual_ship.length; a++)
				_visual_ship[a].setStartCoor(field_params.startX_terget, field_params.startY_terget)
		}
		if(obj == "part_ship"){
			_visual_ship = new Mine(th, "hit_area")
			// _visual_ship.scaleX = _visual_ship.scaleY = .7
			_visual_ship.mouseChildren = false
			_visual_ship.mouseEnabled = false
			_visual_ship.setStartCoor(field_params.startX_flag, field_params.startY_flag)
		}
		if(obj == "rock"){
			_visual_ship = new Mine(th)
			_visual_ship.setGraphics(jsons["JSON2"], "rock_" + kind)
			if(kind == 1 || kind == 3)
				_visual_ship.setStartCoor(12/__koefDisplay, 481/__koefDisplay)
			if(kind == 2)
				_visual_ship.setStartCoor(11/__koefDisplay, 483/__koefDisplay)
			if(kind == 4)
				_visual_ship.setStartCoor(20/__koefDisplay, 484/__koefDisplay)
			_visual_ship.mouseEnabled = false
			_visual_ship.mouseChildren = false

		}
				
	}

	function changeDirection(d){
		_visual_ship.clearGraphics()	
		if(d == "vert"){
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * 0) + (field_params.dx * 1), (-field_params.dy * 0) + (field_params.dy * 1))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * 0) + (field_params.dx * 2), (-field_params.dy * 0) + (field_params.dy * 2))
		}else if(d == "goriz"){			
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * 2) + (field_params.dx * 0), (-field_params.dy * 2) + (field_params.dy * 0))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true, (field_params.dx * 1) + (field_params.dx * 0), (-field_params.dy * 1) + (field_params.dy * 0))
			_visual_ship.setGraphics(jsons["JSON4"], "anim-target", true)
		}
	}

}