avocado-old/packages/react/room.coffee
2019-03-17 23:45:48 -05:00

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