22#ifndef QDENGINE_QDCORE_QD_CONDITION_DATA_H
23#define QDENGINE_QDCORE_QD_CONDITION_DATA_H
25#include "common/std/vector.h"
27#include "qdengine/parser/xml_fwd.h"
49 void set_type(data_t tp) {
53 int get_int(
int index = 0)
const {
54 return reinterpret_cast<const int32 *
>(&*_data.
begin())[index];
56 bool put_int(
int value,
int index = 0) {
57 if (
static_cast<int>(_data.
size()) >=
static_cast<int>((index - 1) *
sizeof(int32))) {
58 reinterpret_cast<int32 *
>(&*_data.
begin())[index] = value;
65 float get_float(
int index = 0)
const {
66 return reinterpret_cast<const float *
>(&*_data.
begin())[index];
68 bool put_float(
float value,
int index = 0) {
69 if (
static_cast<int>(_data.
size()) >=
70 static_cast<int>((index - 1) *
sizeof(
float))) {
71 reinterpret_cast<float *
>(&*_data.
begin())[index] = value;
78 const char *get_string()
const {
80 return &*_data.
begin();
85 bool put_string(
const char *str) {
86 if (alloc_data(strlen(str) + 1)) {
97 bool alloc_data(
int size);
size_type size() const
Definition: array.h:316
bool empty() const
Definition: array.h:352
iterator begin()
Definition: array.h:375
Definition: qd_condition_data.h:31
XML тег.
Definition: xml_tag.h:33
size_t strlcpy(char *dst, const char *src, size_t size)
Базовый класс для игровых ресурсов.
Definition: console.h:28