All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cwinter.codecraft.graphics.model.DynamicModel.scala Maven / Gradle / Ivy

The newest version!
package cwinter.codecraft.graphics.model


private[graphics] class DynamicModel[T](
  val modelFactory: T => Model[Unit]
) extends DecoratorModel[T, Unit] {
  private[this] var _model: Model[Unit] = null
  def model: Model[Unit] = _model

  override protected def displayString: String = "Dynamic"
  override def hasMaterial(material: GenericMaterial): Boolean =
    model == null || model.hasMaterial(material)
  override def update(params: T): Unit =_model = modelFactory(params)
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy