acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
item.h
1// From acme/handler/item.h by camilo on 2023-08-10 16:43 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5#include "acme/user/user/_constant.h"
6#include "acme/handler/item.h"
7#include "acme/prototype/geometry2d/rectangle.h"
8
9
10namespace user
11{
12
13
14 //enum enum_item : ::i64
15 //{
16
17 // e_item_normal = 0,
18 // e_item_tool,
19
20 //};
21
22
23 DECLARE_C_FLAG(e_item, enum_item);
24
25
26 enum enum_item_flag
27 {
28
29 e_item_flag_none = 0,
30 e_item_flag_drawn = 0x800000,
31 e_item_flag_rectangle_callback = 0x4000,
32
33 };
34
35 DECLARE_C_FLAG(e_item_flag, enum_item_flag);
36
37
38//#pragma pack(push, user_ITEM, 1)
39//
40//
41// struct CLASS_DECL_ACME ITEM
42// {
43//
44//
45// union // small 1 bedroom ap
46// {
47// void * m_data[4];
48// struct // this part is structured?!?!?! (hipocritical but ok..)
49// {
50// // they are hipo, so... they think they are aligned...
51// ::user::tool_item * m_ptoolitem;
52// // journalists inventing science that scientists get surprised when we mention to them, you know... - like global warming and ozone layer - so important as these comments... "so a kid is smarter than scientists..." - by lol, what a genius, right?!
53// // universities, media, police, justice, religion and politics, and lately also javascript and invented artificial programming languages, to ensure you give money to professors, journalists and artists, cops and lawyers, juddge, priests and suits, imposed by entertainement, guns, contracts, existence and cheering for a team you just choose. For having few food and fun, you have to give these impostors a lot of money, otherwise instead of movies, they make covid and they work together with universities, media, police, justice and polictis, and religious people obbey laws... ans so on..
54// // wait for the next... they have nothing to do and a lot of time in between to be creative, you know...
55// // journalists could teach to cook... and... universities to build... police muscles for night club entertenament... justice for history... policits for some directions and religion for interpreting the universe... because there are billions of galaxies... because sci-fi is not science, it is a religion of pretending to be better than rich people by knowning some physics... and rich people turn rich on flesh but they are later invited to trampolin to finance the circus above on the shoulders of slaves with some controlled youtube and macdonalds and starbucks...
56// };
57// };
58//
59//
60// ::item_pointer m_pitem;
61// ::i32_point m_pointScreen;
62// ::i32_point m_pointHost;
63// ::i32_point m_pointClient;
64// ::i32_point m_pointHitTest;
65// ::i32_rectangle m_rectangle;
66// ::user::e_item m_eitem;
67// ::particle_pointer m_pparticle;
68// ::user::e_zorder m_ezorder;
69// ::user::e_item_flag m_euseritemflag;
70//
71//
72// ITEM(::item * pitem = nullptr) :
73// m_pitem(pitem)
74// {
75//
76// m_ezorder = ::user::e_zorder_front;
77//
78// }
79//
80//
81// ~ITEM()
82// {
83//
84//
85// }
86//
87//
88// ITEM & operator = (const ITEM & itemdataadditions)
89// {
90//
91// m_pointScreen = itemdataadditions.m_pointScreen;
92// m_pointHost = itemdataadditions.m_pointHost;
93// m_pointClient = itemdataadditions.m_pointClient;
94// m_pointHitTest = itemdataadditions.m_pointHitTest;
95// m_rectangle = itemdataadditions.m_rectangle;
96// //m_uFlags = itemdataadditions.m_uFlags;
97// m_pparticle = itemdataadditions.m_pparticle;
98//
99// return *this;
100//
101// }
102//
103//
104// inline ::user::tool_item * tool_item() { return ::is_set(m_pitem) && m_pitem->m_eitem == e_item_tool ? m_ptoolitem : nullptr; }
105// inline ::user::tool_item * tool_item() const { return ((::user::ITEM *)this)->tool_item(); }
106//
107// bool is_drawn() { return m_euseritemflag & e_item_flag_drawn; }
108//
109// void set_drawn() { m_euseritemflag |= e_item_flag_drawn; }
110//
111//
112//
113// };
114//
115//
116//#pragma pack(pop, user_ITEM)
117
118
119 //struct CLASS_DECL_ACME ITEM_BASE :
120 // public ::particle,
121 // public ::user::ITEM
122 //{
123
124
125
126
127
128 //};
129
130
131
132
133
134
135 //class CLASS_DECL_ACME item_base :
136 // virtual public ::matter,
137 // virtual public ITEM_BASE_ADDITIONS
138 //{
139 //public:
140
141
142 // item_base()
143 // {
144
145 // }
146
147
148 // item_base(const item_base & itembase) :
149 // PARTICLE(itembase),
150 // particle(itembase),
151 // ITEM_BASE_ADDITIONS(itembase)
152 // {
153
154 // }
155
156
157 // item_base(item_base && itembase) :
158 // PARTICLE(::transfer(itembase)),
159 // particle(::transfer(itembase)),
160 // ITEM_BASE_ADDITIONS(::transfer(itembase))
161 // {
162
163 // }
164
165
166 // bool _is_set() const override;
167
168
169 // inline ::collection::index menu_impact_index() const { return (::collection::index)m_iItem; }
170 // inline ::collection::index menu_impact_group() const { return (::collection::index)m_iSubItem; }
171 // inline ::collection::index menu_impact_command() const { return (::collection::index)m_iListItem; }
172
173 // inline ::collection::index item_index() const { return (::collection::index)m_iItem; }
174 // inline ::collection::index subitem_index() const { return (::collection::index)m_iSubItem; }
175 // inline ::collection::index list_item_index() const { return (::collection::index)m_iListItem; }
176
177
178 // item_base & operator = (const ::matter & particle) { id() = particle.id(); return *this; }
179
180
181 // bool operator == (const ::matter & particle) const { return id() == particle.id(); }
182 // bool operator != (const ::matter & particle) const { return !operator == (particle); }
183
184
185 // item_base & operator = (const item_base & itembase) { id() = itembase.id(); ((ITEM_BASE_ADDITIONS &)*this) = ((ITEM_BASE_ADDITIONS &)itembase); return *this; }
186
187
188 // bool operator == (const ::item_base & itembase) const { return id() == itembase.id() && ITEM_BASE_ADDITIONS::operator==(itembase); }
189 // bool operator != (const ::item_base & itembase) const { return !operator == (itembase); }
190
191
192 // //item_base & operator = (const ::PARTICLE & particle) { id() = particle.id(); return *this; }
193
194
195 // //bool operator == (const ::PARTICLE & particle) const { return id() == particle.id(); }
196 // //bool operator != (const ::PARTICLE & particle) const { return !operator == (particle); }
197
198
199 // //item_base & operator = (const ITEM_BASE & itembase) { id() = itembase.id(); ((ITEM_BASE_ADDITIONS &)*this) = ((ITEM_BASE_ADDITIONS &)itembase); return *this; }
200
201
202 // //bool operator == (const ::ITEM_BASE & itembase) const { return id() == itembase.id() && ITEM_BASE_ADDITIONS::operator == (itembase); }
203 // //bool operator != (const ::ITEM_BASE & itembase) const { return !operator == (itembase); }
204
205
206 //};
207
208
209 //struct CLASS_DECL_ACME item_data :
210 // virtual public item_base,
211 // virtual public ITEM_DATA_ADDITIONS
212 //{
213 //public:
214
215
216 // item_data()
217 // {
218
219 // }
220
221
222 // item_data(const item_data & itemdata) :
223 // PARTICLE(itemdata),
224 // particle(itemdata),
225 // ITEM_BASE_ADDITIONS(itemdata),
226 // item_base(itemdata),
227 // ITEM_DATA_ADDITIONS(itemdata)
228 // {
229
230 // }
231
232
233 // item_data(item_data && itemdata) :
234 // PARTICLE(::transfer(itemdata)),
235 // particle(::transfer(itemdata)),
236 // ITEM_BASE_ADDITIONS(::transfer(itemdata)),
237 // item_base(::transfer(itemdata)),
238 // ITEM_DATA_ADDITIONS(::transfer(itemdata))
239 // {
240
241 // }
242
243
244 // item_data & operator = (const ::matter & particle) { id() = particle.id(); return *this; }
245
246
247 // item_data & operator = (const item_base & itembase) { item_base::operator=(itembase); return *this; }
248
249
250 // item_data & operator = (const item_data & itemdata)
251 // {
252
253 // item_base::operator=(itemdata);
254
255 // ITEM_DATA_ADDITIONS::operator=(itemdata);
256
257 // return *this;
258
259 // }
260
261
262 // //item_data & operator = (const ::matter & particle) { id() = particle.id(); return *this; }
263
264
265 // //item_data & operator = (const item_base & itembase) { item_base::operator=(itembase); return *this; }
266
267
268 // //item_data & operator = (const ITEM_DATA & itemdata)
269 // //{
270
271 // // item_base::operator=(itemdata);
272
273 // // ITEM_DATA_ADDITIONS::operator=(itemdata);
274
275 // // return *this;
276
277 // //}
278
279
280 //};
281
290
291 class CLASS_DECL_ACME item :
292 virtual public ::particle
293 // virtual public ::user::ITEM
294 {
295 public:
296 bool m_bSelected : 1;
297
298
299 //item()
300 //{
301
302 //
303
304 //}
305
306 //item(const ::e_element & eelement, ::collection::index iItem = -1, ::collection::index iSubItem = -1, ::collection::index iListItem = -1, const ::u64 uFlags = e_flag_none) :
307 // item(eelement, iItem, iSubItem, iListItem, uFlags) {}
308
309 //item(const ::user::e_flag & eflag, const ::e_element & eelement, ::collection::index iItem = -1, ::collection::index iSubItem = -1, ::collection::index iListItem = -1, const ::atom & atom = ::atom::e_type_null) :
310 // item(eelement, iItem, iSubItem, iListItem, atom, eflag) {}
311
312 //item(const ::e_element & eelement, const ::atom & atom)
313 // : item(eelement, -1, -1, -1, atom)
314 //{
315
316 //}
317
318 //union // small 1 bedroom ap
319 //{
320 // void * m_data[4];
321 // struct // this part is structured?!?!?! (hipocritical but ok..)
322 // {
323 // // they are hipo, so... they think they are aligned...
324 // ::user::tool_item * m_ptoolitem;
325 // // journalists inventing science that scientists get surprised when we mention to them, you know... - like global warming and ozone layer - so important as these comments... "so a kid is smarter than scientists..." - by lol, what a genius, right?!
326 // // universities, media, police, justice, religion and politics, and lately also javascript and invented artificial programming languages, to ensure you give money to professors, journalists and artists, cops and lawyers, juddge, priests and suits, imposed by entertainement, guns, contracts, existence and cheering for a team you just choose. For having few food and fun, you have to give these impostors a lot of money, otherwise instead of movies, they make covid and they work together with universities, media, police, justice and polictis, and religious people obbey laws... ans so on..
327 // // wait for the next... they have nothing to do and a lot of time in between to be creative, you know...
328 // // journalists could teach to cook... and... universities to build... police muscles for night club entertenament... justice for history... policits for some directions and religion for interpreting the universe... because there are billions of galaxies... because sci-fi is not science, it is a religion of pretending to be better than rich people by knowning some physics... and rich people turn rich on flesh but they are later invited to trampolin to finance the circus above on the shoulders of slaves with some controlled youtube and macdonalds and starbucks...
329 // };
330 //};
331
332
333
334 // a user item is a "pointer"/address to a user interface matter
335
336 //::pointer<::draw2d::graphics> m_pgraphics;
337 //::pointer<::geometry2d::region> m_pregion;
338 ::pointer<::draw2d::path> m_ppath;
339 ::pointer<::user::mouse> m_pmouse;
340 //bool m_bAnyHoverChange;
341
342 ::item_pointer m_pitem;
343 //::i32_point m_pointScreen;
344 ::i32_point m_pointHost;
345 ::i32_point m_pointClient;
346 ::i32_point m_pointHitTest;
347 ::i32_rectangle m_rectangle2;
348 ::user::e_item m_eitem;
349 ::particle_pointer m_pparticle;
350 ::user::e_zorder m_ezorder;
351 ::user::e_item_flag m_euseritemflag;
352
353
354 item(::item * pitem = nullptr) :
355 m_pitem(pitem)
356 {
357 m_bSelected = false;
358 m_ezorder = ::user::e_zorder_front;
359
360 }
361
362
363 ~item()
364 {
365
366
367 }
368
369
370 item & operator = (const item & item)
371 {
372
373 //m_pointScreen = item.m_pointScreen;
374 m_pointHost = item.m_pointHost;
375 m_pointClient = item.m_pointClient;
376 m_pointHitTest = item.m_pointHitTest;
377 m_rectangle2 = item.m_rectangle2;
378 //m_uFlags = itemdataadditions.m_uFlags;
379 m_pparticle = item.m_pparticle;
380 m_ppath = item.m_ppath;
381
382 return *this;
383
384 }
385
386
387 //inline ::user::tool_item * tool_item() { return ::is_set(m_pitem) && m_pitem->m_eitem == e_item_tool ? m_ptoolitem : nullptr; }
388 //inline ::user::tool_item * tool_item() const { return ((::user::item *)this)->tool_item(); }
389
390 ::i32_boolean is_drawn() { return m_euseritemflag & e_item_flag_drawn; }
391
392 void set_drawn() { m_euseritemflag |= e_item_flag_drawn; }
393
394
395 //item(::item * pitem = nullptr) :
396 // ITEM(pitem)
397 //{
398
399 //}
400
401
402 //item(const ::e_element & eelement, const enum_id & id)
403 // : item(eelement, -1, -1, -1, id)
404 //{
405
406 //}
407
408 /* item(const ::e_element & eelement = ::e_element_none, ::collection::index iItem = -1, ::collection::index iSubItem = -1, ::collection::index iListItem = -1, const ::atom & atom = ::atom::e_type_null, const ::user::e_flag uFlags = ::user::e_flag_none)
409 {
410
411 id() = atom;
412
413 m_eelement = eelement;
414
415 m_eitem = e_item_normal;
416
417 m_iItem = iItem >= 0 ? iItem : m_eelement != ::e_element_none ? 0 : iItem;
418
419 m_iSubItem = iSubItem;
420
421 m_iListItem = iListItem;
422
423 m_uFlags = uFlags;
424
425 }*/
426
427 /*item(::collection::index iItem)
428 {
429
430 m_eelement = ::e_element_none;
431
432 m_eitem = e_item_normal;
433
434 m_iItem = -1;
435
436 m_iSubItem = -1;
437
438 m_iListItem = -1;
439
440 m_uFlags = 0;
441
442 operator = (iItem);
443
444 }*/
445
446
447 //item(const item & item) :
448 // PARTICLE(item),
449 // particle(item),
450 // m_pitem(item.m_pitem),
451 // //item_base(item),
452 // //ITEM_DATA_ADDITIONS(item),
453 // //item_data(item),
454 // //matter(item)
455 //{
456
457 //}
458
459
460 //item(item && item) :
461 // PARTICLE(::transfer(item)),
462 // particle(::transfer(item)),
463 // ITEM_BASE_ADDITIONS(::transfer(item)),
464 // item_base(::transfer(item)),
465 // ITEM_DATA_ADDITIONS(::transfer(item)),
466 // item_data(::transfer(item)),
467 // matter(::transfer(item))
468 //{
469
470 //}
471
472
473 //bool is_drawn() { return m_uFlags & ITEM_DRAWN; }
474
475 //void set_drawn() { m_uFlags |= ITEM_DRAWN; }
476
477 // virtual string get_user_item_text();
478 // virtual ::collection::index get_user_item_image();
479 // virtual ::image::image_list * get_user_item_image_list();
480
481
482 bool is_item_set() const { return ::is_item_set(m_pitem); }
483
484 explicit operator bool() const { return is_item_set(); }
485
486 ::e_element eelement() const { return is_item_set() ? m_pitem->m_item.m_eelement.m_eenum : e_element_none; }
487
488 ::collection::index item_index() const { return is_item_set() ? m_pitem->m_item.m_iItem : -1; }
489
490 template < typename ITEM >
491 ::pointer < ITEM > as_item() const { return ((::user::item *)this)->as_item< ITEM >(); }
492
493 template < typename ITEM >
494 ::pointer < ITEM > as_item() { return m_pitem.cast < ITEM >(); }
495
496
497 ::atom atom() const { return is_item_set() ? m_pitem->m_atomMatterId : e_element_none; }
498
499 //template < prototype_integral INTEGRAL >
500 //operator INTEGRAL() const { return (INTEGRAL)m_iItem; }
501
502 //bool is_hidden() const;
503
504 //::string get_text(::collection::index iSubItem);
505
506
507 //item & operator = (const ::particle & particle) { id() = if ((PARTICLE *) this != (PARTICLE *)&particle) ::memory_copy((PARTICLE *) this, (PARTICLE *) &particle, sizeof(PARTICLE)); return *this; }
508
509
510 //bool operator == (const ::particle & particle) const { return ((PARTICLE *) this == (PARTICLE *)&particle) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &particle, sizeof(PARTICLE)); }
511 //bool operator != (const ::particle & particle) const { return !operator == (particle); }
512 //
513 //
514 //item & operator = (const item_base & itembase) { if ((void *) this != (void *) &itembase) ::memory_copy((PARTICLE *) this, (PARTICLE *) &itembase, sizeof(ITEM_BASE)); return *this; }
515
516 //bool operator == (const item_base & itembase) const { return ((PARTICLE *) this == (PARTICLE *)&itembase) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &itembase, sizeof(ITEM_BASE)); }
517 //bool operator != (const item_base & itembase) const { return !operator==(itembase); }
518 //
519 //
520
521 //item & operator = (const item_data & itemdata) { if ((PARTICLE *) this != (PARTICLE *) &itemdata) ::memory_copy((PARTICLE *) this, (PARTICLE *) &itemdata, sizeof(ITEM_DATA)); return *this; }
522
523 //bool operator == (const item_data & itemdata) const { return ((PARTICLE *) this == (PARTICLE *) &itemdata) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &itemdata, sizeof(ITEM_DATA)); }
524 //bool operator != (const item_data & itemdata) const { return !operator==(itemdata); }
525 //
526 //
527 //item & operator = (const ::PARTICLE & particle) { if ((PARTICLE *) this != (PARTICLE *) &particle) ::memory_copy((PARTICLE *) this, (PARTICLE *) &particle, sizeof(PARTICLE)); return *this; }
528
529 //
530 //bool operator == (const ::PARTICLE & particle) const { return ((PARTICLE *) this == (PARTICLE *) &particle) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &particle, sizeof(PARTICLE)); }
531 //bool operator != (const ::PARTICLE & particle) const { return !operator == (particle); }
532
533
534 //item & operator = (const ITEM_BASE_ADDITIONS & itembaseadditions) { if ((ITEM_BASE_ADDITIONS *)this != (ITEM_BASE_ADDITIONS *)&itembaseadditions) ::memory_copy((ITEM_BASE_ADDITIONS *)this, (ITEM_BASE_ADDITIONS *)&itembaseadditions, sizeof(ITEM_BASE_ADDITIONS)); return *this; }
535
536 //bool operator == (const ITEM_BASE_ADDITIONS & itembaseadditions) const { return ((ITEM_BASE_ADDITIONS *)this == (ITEM_BASE_ADDITIONS *)&itembaseadditions) ? true : !memcmp((ITEM_BASE_ADDITIONS *)this, (ITEM_BASE_ADDITIONS *)&itembaseadditions, sizeof(ITEM_BASE_ADDITIONS)); }
537 //bool operator != (const ITEM_BASE_ADDITIONS & itembaseadditions) const { return !operator==(itembaseadditions); }
538
539
540 //
541 //item & operator = (const ITEM_BASE & itembase) { if ((PARTICLE *) this != (PARTICLE *) &itembase) ::memory_copy((PARTICLE *) this,(PARTICLE *) &itembase, sizeof(ITEM_BASE)); return *this; }
542
543 //bool operator == (const ITEM_BASE & itembase) const { return ((PARTICLE *) this == (PARTICLE *) &itembase) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &itembase, sizeof(ITEM_BASE)); }
544 //bool operator != (const ITEM_BASE & itembase) const { return !operator==(itembase); }
545 //
546 //
547
548 //item & operator = (const ITEM_DATA & itemdata) { if ((PARTICLE *) this != (PARTICLE *) &itemdata) ::memory_copy((PARTICLE *) this, (PARTICLE *) &itemdata, sizeof(ITEM_DATA)); return *this; }
549
550 //bool operator == (const ITEM_DATA & itemdata) const { return ((PARTICLE *) this == (PARTICLE *) &itemdata) ? true : !memcmp((PARTICLE *) this, (PARTICLE *) &itemdata, sizeof(ITEM_DATA)); }
551 //bool operator != (const ITEM_DATA & itemdata) const { return !operator==(itemdata); }
552
553 //using ITEM::operator=;
554 //using ITEM::operator==;
555 //using item_data::operator!=;
556
557
558 //item & operator = (const item & item)
559 //{
560
561 // ITEM::operator=(item);
562
563 // //m_pgraphics = item.m_pgraphics;
564
565
566 // return *this;
567
568 //}
569
570
571 //bool operator == (const item & item) const { return ITEM::operator ==(item); }
572 //bool operator != (const item & item) const { return !operator==(item); }
573
574
575 //item & operator = (const ::e_element & eelement);
576
577 bool operator == (const ::e_element & eelement) const { return this->eelement() == e_element_none ? false : this->eelement() == eelement; }
578 //bool operator != (const ::e_element & eelement) const { return !operator==(eelement); }
579
580 /*item & operator = (const e_element & eelement) { return operator = ((enum_element)eelement); }
581
582 bool operator == (const e_element & eelement) const { return m_eelement == eelement; }
583 bool operator != (const e_element & eelement) const { return !operator==(eelement); }*/
584
585 //item & operator = (::collection::index iItem);
586
587 //bool operator == (::collection::index iItem) const { return m_iItem == iItem; }
588 //bool operator != (::collection::index iItem) const { return m_iItem != iItem; }
589
590 //bool operator <= (::collection::index iItem) const { return m_iItem <= iItem; }
591 //bool operator >= (::collection::index iItem) const { return m_iItem >= iItem; }
592
593 //bool operator < (::collection::index iItem) const { return m_iItem < iItem; }
594 //bool operator > (::collection::index iItem) const { return m_iItem > iItem; }
595
596 //::collection::index operator + (::i32 iItemAdd) { return (::collection::index)(m_iItem + iItemAdd); }
597 //::collection::index operator - (::i32 iItemSub) { return (::collection::index)(m_iItem - iItemSub); }
598
599 //::collection::index operator + (::i64 iItemAdd) { return (::collection::index)(m_iItem + iItemAdd); }
600 //::collection::index operator - (::i64 iItemSub) { return (::collection::index)(m_iItem - iItemSub); }
601
602
603 /*bool in_element_range(const ::e_element & eelement, ::i32 iCount) const { return m_eelement >= eelement && m_eelement < eelement + iCount; }
604
605 bool is_valid_item(::collection::count c) const { return m_iItem >= 0 && m_iItem < c; }*/
606
607
608
609 //inline ::user::tool_item * tool_item() { return m_eitem == e_item_tool ? m_ptoolitem : nullptr; }
610 //inline ::user::tool_item * tool_item() const { return ((::item *)this)->tool_item(); }
611
612
613 };
614
615 using item_pointer = ::pointer < item >;
616
617 using item_base_pointer = ::pointer < item_base >;
618
619 //using item_pointer = ::pointer < ::user::item >;
620 using item_array = ::pointer_array < item >;
621
622 using item_map = map_base < item_t, item_pointer >;
623
624 using item_base_map = map_base < item_t, item_base_pointer >;
625
626} // namespace user
627
628
629inline bool is_item_set(const ::user::item * puseritem)
630{
631
632 return ::is_set((const void *)puseritem) && puseritem->is_item_set();
633
634}
635
636
637inline bool is_element(const ::user::item * puseritem, const ::e_element & eelement)
638{
639
640 return ::is_item_set(puseritem) && puseritem->eelement() == eelement;
641
642}
643
644
645inline bool is_item(const ::user::item * puseritem, ::collection::index iItem)
646{
647
648 return ::is_item_set(puseritem) && puseritem->item_index() == iItem;
649
650}
651
652
653
654inline bool is_item_index(const ::user::item * pitem, ::collection::index iItem)
655{
656
657 return ::is_element(pitem, ::e_element_item) && ::is_item(pitem, iItem);
658
659}
660
661
662inline bool is_same_item(const ::user::item * pitem1, const ::user::item * pitem2)
663{
664
665 if (::is_item_set(pitem1))
666 {
667
668 if (::is_item_set(pitem2))
669 {
670
671 return ::is_same_item(pitem1->m_pitem, pitem2->m_pitem);
672
673 }
674 else
675 {
676
677 return false;
678
679 }
680
681 }
682 else if (::is_item_set(pitem2))
683 {
684
685 return false;
686
687 }
688 else
689 {
690
691 return true;
692
693 }
694
695}
696
697
698CLASS_DECL_ACME bool is_item_equivalent(const ::user::item * pitem1, const ::user::item * pitem2);
699
700
701inline ::collection::index item_index(const ::user::item * puseritem)
702{
703
704 return ::is_item_set(puseritem) ? puseritem->item_index() : -1;
705
706}
707
708
709
Created by camilo on 2026-05-28 12:34 <3ThomasBorregaardSørensen!! Mummi!! Bilbo!!
Definition _.h:67