/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 431:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Cell = void 0;
var GameObject_1 = __webpack_require__(607);
var CELL_VIEWS = {
    normal: {
        fillStyle: '#0059ff',
    },
    hover: {
        fillStyle: '#60000b',
    },
    click: {
        fillStyle: '#fff91f',
    }
};
var Cell = /** @class */ (function (_super) {
    __extends(Cell, _super);
    function Cell(_a) {
        var x = _a.x, y = _a.y, disabled = _a.disabled;
        var _this = _super.call(this) || this;
        _this.draw = function (canvas) {
            console.log('draw');
            var viewParams = CELL_VIEWS[_this.state.currentView];
            _this.object = canvas.drawRect({
                fillStyle: viewParams.fillStyle,
                // strokeStyle: viewParams.fillStyle,
                x: _this.x,
                y: _this.y,
                width: Cell.width,
                height: Cell.height
            });
        };
        _this.state = {
            currentView: 'normal'
        };
        _this.x = x;
        _this.y = y;
        _this.disabled = disabled;
        if (!disabled) {
            // листенеры добавляются раньше чем реализовывается метод addEventListener
            // this.addEventListener(ActionTypes.MouseDown, () => this.setState({currentView: 'click'}));
            // this.addEventListener(ActionTypes.MouseUp, () => this.setState({currentView: 'normal'}));
            // this.addEventListener(ActionTypes.MouseOver, () => this.setState({currentView: 'hover'}));
            // this.addEventListener(ActionTypes.MouseOut, () => this.setState({currentView: 'normal'}));
        }
        return _this;
    }
    return Cell;
}(GameObject_1.CanvasObject));
exports.Cell = Cell;
exports["default"] = Cell;


/***/ }),

/***/ 607:
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CanvasObject = void 0;
function addEventListener(type, cb) {
    this.listeners[type] = cb;
}
var CanvasObject = /** @class */ (function () {
    function CanvasObject() {
        this.isOver = false;
        this.listeners = {};
        this.addEventListener = addEventListener.bind(this);
        this.map = {};
        this.id = -1;
        this.gridColor = 'black';
        this.isCb = function (arg) { return typeof arg === 'function'; };
    }
    return CanvasObject;
}());
exports.CanvasObject = CanvasObject;


/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module is referenced by other modules so it can't be inlined
/******/ 	var __webpack_exports__ = __webpack_require__(431);
/******/ 	var __webpack_export_target__ = exports;
/******/ 	for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
/******/ 	if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
/******/ 	
/******/ })()
;