CORE/Test.gd

55 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:
2024-02-10 21:21:18 +01:00
Release (semantic) = %release_semantic%
Release = %release%
Typerelease = %release_type%
Type = %type%
Type (technical) = %type_technical%
Development mode = %devmode%
Headless mode = %headless%
Custom module support = %custommodules%"""))
# 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
2024-02-10 21:21:18 +01:00
config.debugging = true
2024-02-04 21:36:30 +01:00
config.logger_level = CoreTypes.LoggerLevel.DIAG