<commit_before>package com.jenjinstudios.world.client;

import com.jenjinstudios.core.io.Message;
import com.jenjinstudios.world.Actor;
import com.jenjinstudios.world.client.message.WorldClientMessageFactory;
import com.jenjinstudios.world.state.MoveState;

import java.util.LinkedList;

/**
 * Responsible for updating the world.
 * @author <NAME>
 */
public class WorldClientUpdater implements Runnable
{
	/** The client being updated by this runnable. */
	private final WorldClient worldClient;
	/** The player being controlled by the world client. */
	private final Actor player;

	/**
	 * Construct a new {@code WorldClientUpdater} for the given client.
	 * @param wc The world client.
	 */
	public WorldClientUpdater(WorldClient wc) {
		this.worldClient = wc;
		this.player = worldClient.getPlayer();
	}

	@Override
	public void run() {
		worldClient.getWorld().update();
		if (player != null)
		{
			LinkedList<MoveState> newStates = player.getStateChanges();
			while (!newStates.isEmpty())
			{
				MoveState moveState = newStates.remove();
				WorldClientMessageFactory messageFactory = worldClient.getMessageFactory();
				Message stateChangeRequest = messageFactory.generateStateChangeRequest(moveState);
				worldClient.queueOutgoingMessage(stateChangeRequest);
			}
		}
	}
}
<commit_msg>Added sight calculation to WorldClient<commit_after>package com.jenjinstudios.world.client;

import com.jenjinstudios.core.io.Message;
import com.jenjinstudios.world.Actor;
import com.jenjinstudios.world.client.message.WorldClientMessageFactory;
import com.jenjinstudios.world.math.SightCalculator;
import com.jenjinstudios.world.state.MoveState;

import java.util.LinkedList;

/**
 * Responsible for updating the world.
 * @author <NAME>
 */
public class WorldClientUpdater implements Runnable
{
	/** The client being updated by this runnable. */
	private final WorldClient worldClient;
	/** The player being controlled by the world client. */
	private final Actor player;

	/**
	 * Construct a new {@code WorldClientUpdater} for the given client.
	 * @param wc The world client.
	 */
	public WorldClientUpdater(WorldClient wc) {
		this.worldClient = wc;
		this.player = worldClient.getPlayer();
	}

	@Override
	public void run() {
		worldClient.getWorld().update();
		SightCalculator.updateVisibleObjects(worldClient.getWorld());
		if (player != null)
		{
			LinkedList<MoveState> newStates = player.getStateChanges();
			while (!newStates.isEmpty())
			{
				MoveState moveState = newStates.remove();
				WorldClientMessageFactory messageFactory = worldClient.getMessageFactory();
				Message stateChangeRequest = messageFactory.generateStateChangeRequest(moveState);
				worldClient.queueOutgoingMessage(stateChangeRequest);
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.10276967930029154, 'fraction_numerical': 0.0, 'mean_word_length': 4.791139240506329, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2409397', 'n_tokens_mistral': 871, 'n_tokens_neox': 807, 'n_words': 189}