rott/kf_sources/AcediaCore/Classes/TemplatesGameplayAPI.uc
2026-07-14 20:27:09 +07:00

84 lines
3.2 KiB
Ucode

/**
* Author: dkanus
* Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore
* License: GPL
* Copyright 2022-2024 Anton Tarasenko
*------------------------------------------------------------------------------
* This file is part of Acedia.
*
* Acedia 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, version 3 of the License, or
* (at your option) any later version.
*
* Acedia 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 Acedia. If not, see <https://www.gnu.org/licenses/>.
*/
class TemplatesGameplayAPI extends AcediaObject
abstract
dependson(Entity);
//! API for registering templates under given names and storing named lists
//! of templates.
/// Returns `true` if list of templates named `listName` exists and
/// `false` otherwise.
public function bool IsListAvailable(BaseText listName) {
return false;
}
/// Returns array with templates belonging to the [`listName`] list.
///
/// Returns empty array if there is no list with a specified name.
/// Use [`ItemListExists()`] to check which is the case.
///
/// All implementations must support:
///
/// 1. "all weapons" / "weapons" (both names should refer to the same list)
/// list with templates of all weapons in the game;
/// 2. "trading weapons" list with names of all weapons available for trade in
/// one way or another (even if they are not all tradable in
/// all shops / for all players).
public function array<Text> GetItemList(BaseText listName) {
local array<Text> emptyArray;
return emptyArray;
}
/// Returns array that is listing all available lists of templates.
///
/// All implementations must include "all weapons" and "trading weapons" lists.
///
/// All of the `Text`s in the returned array are guaranteed to be `none`.
/// If a certain list has several names (like "all weapons" / "weapons"),
/// only one of these names (guaranteed to always be the same between calls)
/// will be included.
public function array<Text> GetAvailableLists() {
local array<Text> emptyArray;
return emptyArray;
}
/// Checks whether a template with the given name is registered.
public function Entity.Template IsTemplateRegistered(BaseText templateName);
/// Retrieves a template registered under the specified name.
///
/// Returns an empty [`Entity::Template`] struct (with fields set to `none` and
/// arrays empty) if no such template exists.
/// This condition can be checked using [`IsTemplateRegistered()`].
public function Entity.Template GetTemplate(BaseText templateName);
/// Registers or updates a template under the specified name.
///
/// Replaces any existing template, discarding them.
/// The template name must consist of only printable ASCII characters.
public function AcediaError SetTemplate(BaseText templateName, Entity.Template templateData);
defaultproperties {
}