CORE/Test.gd

54 lines
2.6 KiB
GDScript3
Raw Normal View History

2024-02-04 21:36:30 +01:00
##############################################################################
### CORE FRAMEWORK SOURCE FILE ###
### Copyright (c) 2024 The StarOpenSource Project & Contributors ###
### Licensed under the GNU General Public License v3 ###
### ###
### This program is free software: you can redistribute it and/or modify ###
### it under the terms of the GNU General Public License as published by ###
### the Free Software Foundation, either version 3 of the License, or ###
### (at your option) any later version. ###
### ###
### This program 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 General Public License for more details. ###
### ###
### You should have received a copy of the GNU General Public License ###
### along with this program. If not, see <https://www.gnu.org/licenses/>. ###
##############################################################################
### Test.gd (Testing script) ###
### ###
### This script is used to test CORE's behaviour during development. ###
### It's state should be reverted to how it was before committing. ###
##############################################################################
extends Node
# CORE Configuration
var config: CoreConfiguration = CoreConfiguration.new()
# CORE Object
var core: Core
func _ready() -> void:
configure_core()
# Initialize CORE with custom config
core = Core.new(config)
# Inject CORE
add_child(core)
# Print information about CORE
core.logger.info(await core.get_formatted_string("""Version information:
Release (semantic) = %release_semantic%
Release = %release%
Type = %type%
Type (technical) = %type_technical%
Typerelease = %release_type%
Development mode = %devmode%
Headless mode = %headless%"""))
# Print hi
core.logger.info("Hi there!")
2024-02-04 21:36:30 +01:00
# Update CORE configuration
func configure_core() -> void:
config.headless = false
config.debug_allow = true
config.logger_level = CoreTypes.LoggerLevel.DIAG