com.swingfrog.summer.ecs.component.AbstractBeanBaseComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of summer Show documentation
Show all versions of summer Show documentation
a lightweight game server framework
package com.swingfrog.summer.ecs.component;
import com.swingfrog.summer.app.Summer;
import com.swingfrog.summer.db.repository.Repository;
import com.swingfrog.summer.ecs.EcsRuntimeException;
import com.swingfrog.summer.ecs.annotation.BindRepository;
import com.swingfrog.summer.ecs.entity.Entity;
public abstract class AbstractBeanBaseComponent> extends AbstractComponent {
final Repository repository;
public AbstractBeanBaseComponent(E entity) {
super(entity);
BindRepository bindRepository = this.getClass().getAnnotation(BindRepository.class);
if (bindRepository == null)
throw new EcsRuntimeException("not found @BindRepository -> %s", this.getClass().getName());
repository = Summer.getComponent(bindRepository.value());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy