<commit_before>/*
 *  caosVM_time.cpp
 *  openc2e
 *
 *  Created by <NAME> on Sat Jun 05 2004.
 *  Copyright (c) 2004 <NAME>. All rights reserved.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 */

#include "caosVM.h"
#include "World.h"
#include <time.h> // gmtime and strftime

/**
 PACE (float)
 %status maybe

 return speed factor of last ten ticks.
 
 < 1.0 = engine is ticking slower than BUZZ rating. > 1.0 = engine is ticking faster.

 You might want to use this to reduce the amount of agents created or the amount of processing done if the speed factor is below 1.0.
*/
void caosVM::v_PACE() {
	result.setFloat(world.pace);
}

/**
 BUZZ (command) interval (integer)
 %status maybe
*/
void caosVM::c_BUZZ() {
	VM_PARAM_INTEGER(interval)

	world.ticktime = interval;
}

/**
 BUZZ (integer)
 %status maybe
*/
void caosVM::v_BUZZ() {
	result.setInt(world.ticktime);
}

/**
 DATE (integer)
 %status stub

 Returns the day in the season of the current game world, starting at 0.
*/
void caosVM::v_DATE() {
	result.setInt(0); // TODO
}

/**
 HIST DATE (integer) tick (integer)
 %status stub
 
 Returns the day in the season of the current game world at the specified world tick, starting at 0. See DATE.
*/
void caosVM::v_HIST_DATE() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 SEAN (integer)
 %status stub

 Returns the current game world season. 0 is spring, 1 is summer, 2 is autumn and 3 is winter.
*/
void caosVM::v_SEAN() {
	result.setInt(0); // TODO
}

/**
 HIST SEAN (integer)
 %status stub

 Returns the current game world season at the specified world tick. 0 is spring, 1 is summer, 2 is autumn and 3 is winter. See SEAN.
*/
void caosVM::v_HIST_SEAN() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 TIME (integer)
 %status stub

 Returns the time of day in the current game world. 0 is dawn, 1 is morning, 2 is afternoon, 3 is evening and 4 is night.
*/
void caosVM::v_TIME() {
	result.setInt(0); // TODO
}

/**
 HIST TIME (integer)
 %status stub
 
 Returns the time of day in the current game world at the specified world tick. 0 is dawn, 1 is morning, 2 is afternoon, 3 is evening and 4 is night. See TIME.
*/
void caosVM::v_HIST_TIME() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 YEAR (integer)
 %status stub

 Returns the number of game years elapsed in the current world.
*/
void caosVM::v_YEAR() {
	result.setInt(0); // TODO
}

/**
 HIST YEAR (integer)
 %status stub

 Returns the number of game years elapsed at the specified world tick. See YEAR.
*/
void caosVM::v_HIST_YEAR() {
	VM_PARAM_INTEGER(tick)
<commit_msg>whoops, fix CAOS prototypes for HIST SEAN/TIME/YEAR<commit_after>/*
 *  caosVM_time.cpp
 *  openc2e
 *
 *  Created by <NAME> on Sat Jun 05 2004.
 *  Copyright (c) 2004 <NAME>. All rights reserved.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 */

#include "caosVM.h"
#include "World.h"
#include <time.h> // gmtime and strftime

/**
 PACE (float)
 %status maybe

 return speed factor of last ten ticks.
 
 < 1.0 = engine is ticking slower than BUZZ rating. > 1.0 = engine is ticking faster.

 You might want to use this to reduce the amount of agents created or the amount of processing done if the speed factor is below 1.0.
*/
void caosVM::v_PACE() {
	result.setFloat(world.pace);
}

/**
 BUZZ (command) interval (integer)
 %status maybe
*/
void caosVM::c_BUZZ() {
	VM_PARAM_INTEGER(interval)

	world.ticktime = interval;
}

/**
 BUZZ (integer)
 %status maybe
*/
void caosVM::v_BUZZ() {
	result.setInt(world.ticktime);
}

/**
 DATE (integer)
 %status stub

 Returns the day in the season of the current game world, starting at 0.
*/
void caosVM::v_DATE() {
	result.setInt(0); // TODO
}

/**
 HIST DATE (integer) tick (integer)
 %status stub
 
 Returns the day in the season of the current game world at the specified world tick, starting at 0. See DATE.
*/
void caosVM::v_HIST_DATE() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 SEAN (integer)
 %status stub

 Returns the current game world season. 0 is spring, 1 is summer, 2 is autumn and 3 is winter.
*/
void caosVM::v_SEAN() {
	result.setInt(0); // TODO
}

/**
 HIST SEAN (integer) tick (integer)
 %status stub

 Returns the current game world season at the specified world tick. 0 is spring, 1 is summer, 2 is autumn and 3 is winter. See SEAN.
*/
void caosVM::v_HIST_SEAN() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 TIME (integer)
 %status stub

 Returns the time of day in the current game world. 0 is dawn, 1 is morning, 2 is afternoon, 3 is evening and 4 is night.
*/
void caosVM::v_TIME() {
	result.setInt(0); // TODO
}

/**
 HIST TIME (integer) tick (integer)
 %status stub
 
 Returns the time of day in the current game world at the specified world tick. 0 is dawn, 1 is morning, 2 is afternoon, 3 is evening and 4 is night. See TIME.
*/
void caosVM::v_HIST_TIME() {
	VM_PARAM_INTEGER(tick)

	result.setInt(0); // TODO
}

/**
 YEAR (integer)
 %status stub

 Returns the number of game years elapsed in the current world.
*/
void caosVM::v_YEAR() {
	result.setInt(0); // TODO
}

/**
 HIST YEAR (integer) tick (integer)
 %status stub

 Returns the number of game years elapsed at the specified world tick. See YEAR.
*/
void caosVM::v_HIST_YEAR() {
	VM_PARAM_INTEGER(tick)

{'fraction_non_alphanumeric': 0.10396914671380363, 'fraction_numerical': 0.014462477904547646, 'mean_word_length': 3.5134155184916604, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2305254', 'n_tokens_mistral': 2123, 'n_tokens_neox': 2009, 'n_words': 842}