Elaztek Developer Hub
Switch Project...
blam!
Editing Kit
Guerilla
Sapien
Tool
Foundry
Libraries
Keystone
Strings
Forums
Discord
Doxygen
Jenkins
Guides
Gitlab
Blamite Game Engine - blam!
00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
version.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "../console.h"
4
5
#include "
components/content/cache_files/cache_files.h
"
6
#include "
components/content/tags/tags.h
"
7
#include "
components/diagnostics/logger/logger.h
"
8
#include "
components/resources/engine_definitions/engine_definitions.h
"
9
#include "
version_data.h
"
10
11
namespace
Blam::Resources::Console
12
{
18
class
VersionCommand
:
public
BlamConsoleCommand
19
{
20
public
:
21
VersionCommand
()
22
{
23
name
=
"version"
;
24
description
=
"Show engine version information."
;
25
aliases
= {
"ver"
};
26
27
type
=
BlamCommandType::Builtin
;
28
}
29
30
~VersionCommand
()
31
{
32
33
}
34
35
BlamCommandResult
onCommand
(std::vector<std::string> arguments)
36
{
37
std::string minor_version = std::to_string(TAG_FIELDSET_VERSION);
38
std::string cache_file_language =
Blam::Content::CacheFiles::GetCacheFileLanguageString
(
CACHE_FILE_LANGUAGE
);
39
std::string git_commit = std::string(
CURRENT_COMMIT
);
40
41
cache_file_language = BlamStrings::Utils::String::ToLower(cache_file_language);
42
43
Blam::Logger::LogEventForce
(
Blam::EngineDefs::GetVersionBuildString
(
BlamVersionStringDisplayMode::Console
), WSV_NONE);
44
Blam::Logger::LogEventForce
(
"minor version "
+ minor_version +
" cache file language "
+ cache_file_language, WSV_NONE);
45
Blam::Logger::LogEventForce
(
"git commit "
+ git_commit, WSV_NONE);
46
//Blam::Logger::LogEventForce("the above message is a placeholder taken from halo 2 pc sapien editor", WSV_ERROR);
47
48
return
BlamCommandResult::Ok
;
49
}
50
};
51
}
Blam::Content::CacheFiles::GetCacheFileLanguageString
BLAM std::string GetCacheFileLanguageString(BlamCacheFileLanguage language)
Retrieves the current cache file language as a string.
Definition:
cache_files.cpp:10
Blam::Resources::Console::VersionCommand
Class for the version command.
Definition:
version.hpp:18
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
Blam::Resources::Console::VersionCommand::VersionCommand
VersionCommand()
Definition:
version.hpp:21
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition:
console.h:59
logger.h
version_data.h
Blam::Resources::Console::VersionCommand::~VersionCommand
~VersionCommand()
Definition:
version.hpp:30
BlamConsoleCommand
Class used to represent a console command.
Definition:
console.h:56
BlamVersionStringDisplayMode::Console
@ Console
Indicates the build string should be formatted for the in-game console.
cache_files.h
Blam::EngineDefs::GetVersionBuildString
BLAM std::string GetVersionBuildString(BlamVersionStringDisplayMode display_mode)
Retrieves the build string of the engine.
Definition:
engine_definitions.cpp:53
BlamCommandResult
BlamCommandResult
Indicates the return state of a console command.
Definition:
console.h:22
CACHE_FILE_LANGUAGE
#define CACHE_FILE_LANGUAGE
Macro specifiying cache file language.
Definition:
cache_files.h:18
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition:
console.h:58
CURRENT_COMMIT
#define CURRENT_COMMIT
Definition:
version_data.h:14
engine_definitions.h
Blam::Resources::Console::VersionCommand::onCommand
BlamCommandResult onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition:
version.hpp:35
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition:
console.h:63
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition:
aliases.cpp:274
tags.h
BlamConsoleCommand::aliases
std::vector< std::string > aliases
A list of aliases for the command. Executing any of these instead of the command name will behave the...
Definition:
console.h:61
BlamCommandResult::Ok
@ Ok
The command was run without error.
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition:
abort.hpp:5
blam
components
resources
console
commands
version.hpp
Generated on Fri Sep 22 2023 23:44:57 for Blamite Game Engine - blam! by
1.8.17