30 lines
512 B
CoffeeScript
30 lines
512 B
CoffeeScript
import PropTypes from 'prop-types'
|
|
import React from 'react'
|
|
|
|
import {Room2DView} from '@avocado/environment'
|
|
|
|
class Room extends React.Component
|
|
|
|
@propTypes =
|
|
|
|
roomView: PropTypes.instanceOf(Room2DView).isRequired
|
|
|
|
constructor: (props) ->
|
|
|
|
super props
|
|
|
|
props.roomView.on [
|
|
'roomChanged', 'tilesetChanged'
|
|
], @tickContainer
|
|
|
|
render: ->
|
|
|
|
@props.setIntoContainer @props.roomView
|
|
@tickContainer()
|
|
|
|
return null
|
|
|
|
tickContainer: => @props.tickContainer()
|
|
|
|
export default Room
|