<commit_before>package com.kanomiya.steward;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;

import com.kanomiya.steward.common.FrameWithView;
import com.kanomiya.steward.common.Game;
import com.kanomiya.steward.common.controller.ControlListener;
import com.kanomiya.steward.common.model.assets.Assets;
import com.kanomiya.steward.common.model.assets.AssetsFactory;
import com.kanomiya.steward.common.model.overlay.GameColor;
import com.kanomiya.steward.common.model.overlay.Text;
import com.kanomiya.steward.common.model.overlay.message.Message;
import com.kanomiya.steward.common.model.overlay.message.MessageBook;
import com.kanomiya.steward.common.view.ViewConsts;



public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		File savesDir = new File("saves");
		if (! savesDir.exists()) savesDir.mkdir();





		AssetsFactory afact = AssetsFactory.newInstance();
		Assets assets = afact.newAssets();

		// DEBUG
		// System.out.println(assets.toString());


		Game game = new Game(assets, assets.getPlayer());


		FrameWithView frame = new FrameWithView(ViewConsts.viewGame, game);
		ViewConsts.viewGame.setSize(ViewConsts.viewWidth, ViewConsts.viewHeight);

		frame.setResizable(false);
		frame.pack();
		// frame.setPreferredSize(new Dimension(ViewConsts.viewWidth, ViewConsts.viewHeight));
		frame.setRealSize(ViewConsts.viewWidth, ViewConsts.viewHeight);

		frame.setTitle("Steward");
		frame.setLocation(60, 30);
		frame.addWindowListener(new WindowAdapter()
		{
			@Override
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});

		frame.addComponentListener(new ComponentAdapter()
		{
			@Override public void componentResized(ComponentEvent e)
			{
				frame.setRealSize(ViewConsts.viewWidth, ViewConsts.viewHeight);
			}
		});

		ControlListener cl = new ControlListener();
		cl.game = game;
		cl.gameFrame = frame;
		cl.frameInsets = frame.getInsets();

		cl.changeMode(game.thePlayer.mode);

		frame.addKeyListener(cl);
		frame.addMouseListener(cl);
		frame.addMouseMotionListener(cl);


		frame.setVisible(true);


		Thread repainter = new Thread("Repainter")
		{
			@Override public void run()
			{
				while (frame.isVisible())
				{
					frame.repaint();

					try {
						sleep(ViewConsts.frameLifeMills);
					} catch (InterruptedException e) {
						// TODO 自動生成された catch ブロック
						e.printStackTrace();
					}
				}
			}
		};

		repainter.start();


		game.thePlayer.logger.println(Text.create(game.assets.translate("vocabulary.welcome")).color(GameColor.orange));

		game.thePlayer.showMessage(
				MessageBook.create().append(
						Message.create().println(Text.create("*ぽえー*").color(GameColor.green))
						).append(
								Message.create().println(Text.create("Stewardを起動しました").color(GameColor.orange)
										).println(Text.create("改行てすと")
												).println(Text.create("改行てすと")
														).println(Text.create("改行てすと")
																).println(Text.create("改行てすと")
																		).println(Text.create("改行てすと")
																				).println(Text.create("改行てすと")
																						).println(Text.create("改行てすと")
																								).println(Text.create("改行てすと")
										).lockClose()
								).append(
										Message.create().println(Text.create("@は仮テクスチャのイベントテストです").color(GameColor.orange))
										)<commit_msg>初期メッセージデモを変更<commit_after>package com.kanomiya.steward;

import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;

import com.kanomiya.steward.common.FrameWithView;
import com.kanomiya.steward.common.Game;
import com.kanomiya.steward.common.controller.ControlListener;
import com.kanomiya.steward.common.model.assets.Assets;
import com.kanomiya.steward.common.model.assets.AssetsFactory;
import com.kanomiya.steward.common.model.overlay.GameColor;
import com.kanomiya.steward.common.model.overlay.Text;
import com.kanomiya.steward.common.model.overlay.message.Message;
import com.kanomiya.steward.common.model.overlay.message.MessageBook;
import com.kanomiya.steward.common.view.ViewConsts;



public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		File savesDir = new File("saves");
		if (! savesDir.exists()) savesDir.mkdir();





		AssetsFactory afact = AssetsFactory.newInstance();
		Assets assets = afact.newAssets();

		// DEBUG
		// System.out.println(assets.toString());


		Game game = new Game(assets, assets.getPlayer());


		FrameWithView frame = new FrameWithView(ViewConsts.viewGame, game);
		ViewConsts.viewGame.setSize(ViewConsts.viewWidth, ViewConsts.viewHeight);

		frame.setResizable(false);
		frame.pack();
		// frame.setPreferredSize(new Dimension(ViewConsts.viewWidth, ViewConsts.viewHeight));
		frame.setRealSize(ViewConsts.viewWidth, ViewConsts.viewHeight);

		frame.setTitle("Steward");
		frame.setLocation(60, 30);
		frame.addWindowListener(new WindowAdapter()
		{
			@Override
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});

		frame.addComponentListener(new ComponentAdapter()
		{
			@Override public void componentResized(ComponentEvent e)
			{
				frame.setRealSize(ViewConsts.viewWidth, ViewConsts.viewHeight);
			}
		});

		ControlListener cl = new ControlListener();
		cl.game = game;
		cl.gameFrame = frame;
		cl.frameInsets = frame.getInsets();

		cl.changeMode(game.thePlayer.mode);

		frame.addKeyListener(cl);
		frame.addMouseListener(cl);
		frame.addMouseMotionListener(cl);


		frame.setVisible(true);


		Thread repainter = new Thread("Repainter")
		{
			@Override public void run()
			{
				while (frame.isVisible())
				{
					frame.repaint();

					try {
						sleep(ViewConsts.frameLifeMills);
					} catch (InterruptedException e) {
						// TODO 自動生成された catch ブロック
						e.printStackTrace();
					}
				}
			}
		};

		repainter.start();


		game.thePlayer.logger.println(Text.create(game.assets.translate("vocabulary.welcome")).color(GameColor.orange));

		game.thePlayer.showMessage(
				MessageBook.create(
						).append(
								Message.create().println(Text.create("このページはEscクローズが有効です"))
						).append(
							Message.create().println(Text.create("Stewardを起動しました").color(GameColor.orange)
									).println(Text.create(" ")
											).println(Text.create("このページのEscクローズはロックされています")
													).lockClose()
						).append(
								Message.create().println(Text.create("このページは左右スクロール及びEscクローズが有効です"))
						).append(
								Message.create().println(Text.create("@は仮テクスチャのイベントテストです").color(GameColor.orange))
						)
{'fraction_non_alphanumeric': 0.13410818059901655, 'fraction_numerical': 0.0014900908955446282, 'mean_word_length': 3.7977126518942104, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7569886', 'n_tokens_mistral': 2712, 'n_tokens_neox': 2246, 'n_words': 297}