<commit_before>package jlarv;
 /*
    Abstract base class from which every system will inherit from.
    Systems implement  the logic around the game.
    Every system will need to override the update method.

    Update method will be called every game loop and must implement the logic 
    of the system (aka, where the magic happens).

    When wanting to get components from entity manager, remember to call for those
    using component_class.__name__, else they will not be recognized.
  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
public abstract class System {
	private EntityManager entity_manager;
	private EntityFactory entity_factory;
	private GroupManager group_manager;
	
	/**
	 * Getters and setters.
	 * Setters will be called whenever a System is added into an Engine.
	 */
	protected EntityManager getEntityManager() {
		return entity_manager;
	}	
	protected EntityFactory getEntityFactory() {
		return entity_factory;
	}	
	protected GroupManager getGroupManager() {
		return group_manager;
	}
	
	protected void setEntityManager(EntityManager entity_manager) {
		this.entity_manager = entity_manager;
	}
	protected void setEntityFactory(EntityFactory entity_factory) {
		this.entity_factory = entity_factory;
	}
	protected void setGroupManager(GroupManager group_manager) {
		this.group_manager = group_manager;
	}
	
	/**
	 * Update method will be called from engine in every game tick.
	 * It will iterate over entities and components and process them.
	 */
	public abstract void update();	
}<commit_msg>Added Comparable to System<commit_after>package jlarv;
 /*
    Abstract base class from which every system will inherit from.
    Systems implement  the logic around the game.
    Every system will need to override the update method.

    Update method will be called every game loop and must implement the logic 
    of the system (aka, where the magic happens).

    When wanting to get components from entity manager, remember to call for those
    using component_class.__name__, else they will not be recognized.
  */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
public abstract class System implements Comparable<System> {
	private EntityManager entity_manager;
	private EntityFactory entity_factory;
	private GroupManager group_manager;
	private int priority;
	
	public System (int priority) {
		this.priority = priority;
	}
	public System () {
		this.priority = 0;
	}
	/**
	 * Getters and setters.
	 * Setters will be called whenever a System is added into an Engine.
	 */
	protected EntityManager getEntityManager() {
		return entity_manager;
	}	
	protected EntityFactory getEntityFactory() {
		return entity_factory;
	}	
	protected GroupManager getGroupManager() {
		return group_manager;
	}
	protected int getPriority() {
		return priority;
	}
	
	protected void setEntityManager(EntityManager entity_manager) {
		this.entity_manager = entity_manager;
	}
	protected void setEntityFactory(EntityFactory entity_factory) {
		this.entity_factory = entity_factory;
	}
	protected void setGroupManager(GroupManager group_manager) {
		this.group_manager = group_manager;
	}
	protected void setPriority (int priority) {
		this.priority = priority;
	}
	
	/**
	 * Update method will be called from engine in every game tick.
	 * It will iterate over entities and components and process them.
	 */
	public abstract void update();
	
	/**
	 * Implement Comparator interface.
	 * This method returns -1 if this system is lower than the other system,
	 * 0 if they're equal and 1 if this system is greater than the given
	 * one.
	 * This allows us to iterate over the systems in priority order.
	 * The system with the lower priority will be the first to update.
	 */
	@Override 
	public final int compareTo(System other) {
		if (this.priority < other.priority) {
			return -1;
		}
		else if(this.priority == other.priority) {
			return 0;
		}
		else {
			return 1;
		}
	}
}
{'fraction_non_alphanumeric': 0.04601527315449383, 'fraction_numerical': 0.0013706677109849227, 'mean_word_length': 1.454589139836617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 64, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3682937', 'n_tokens_mistral': 1066, 'n_tokens_neox': 988, 'n_words': 415}