FastEngine 0.9.4
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
C_networkType.inl
1/*
2 * Copyright 2025 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17namespace fge::net
18{
19
21
22template<class T>
24 g_typeCopy(source._getter()),
25 g_typeSource(std::move(source))
26{}
27
28template<class T>
29void const* NetworkType<T>::getSource() const
30{
31 return &this->g_typeSource;
32}
33template<class T>
35{
36 if (pck >> this->g_typeCopy)
37 {
38 this->g_typeSource._setter(this->g_typeCopy);
39 this->setLastUpdateTime();
40 this->clearWaitingUpdateFlag();
41 this->_onApplied.call();
42 return true;
43 }
44 return false;
45}
46template<class T>
48{
49 if (this->clearModificationFlag(id))
50 {
51 pck << this->g_typeSource._getter();
52 }
53}
54template<class T>
56{
57 pck << this->g_typeSource._getter();
58}
59template<class T>
61{
62 return (this->g_typeSource._getter() != this->g_typeCopy) || this->_g_force;
63}
64template<class T>
66{
67 this->_g_force = true;
68}
69template<class T>
71{
72 this->_g_force = false;
73 this->g_typeCopy = this->g_typeSource._getter();
74}
75
77
78template<class T>
80 g_typeSource(source)
81{
82 source->setType<T>();
83}
84
85template<class T>
87{
88 return this->g_typeSource;
89}
90
91template<class T>
93{
94 pck >> this->g_typeSource->template setType<T>();
95
96 this->setLastUpdateTime();
97 this->clearWaitingUpdateFlag();
98 this->_onApplied.call();
99 return true;
100}
101template<class T>
103{
104 if (this->clearModificationFlag(id))
105 {
106 pck << this->g_typeSource->template setType<T>();
107 }
108}
109template<class T>
111{
112 pck << this->g_typeSource->template setType<T>();
113}
114
115template<class T>
117{
118 return this->g_typeSource->isModified();
119}
120template<class T>
122{
123 this->g_typeSource->setModifiedFlag(true);
124}
125template<class T>
127{
128 this->g_typeSource->setModifiedFlag(false);
129}
130
132template<class T>
134 g_typeSource(source),
135 g_vname(vname)
136{
137 fge::Property& property = source->getProperty(vname);
138 property.setType<T>();
139}
140
141template<class T>
143{
144 return this->g_typeSource;
145}
146
147template<class T>
149{
150 fge::Property& property = this->g_typeSource->getProperty(this->g_vname);
151
152 pck >> property.setType<T>();
153
154 this->setLastUpdateTime();
155 this->clearWaitingUpdateFlag();
156 this->_onApplied.call();
157 return false;
158}
159template<class T>
161{
162 if (this->clearModificationFlag(id))
163 {
164 fge::Property& property = this->g_typeSource->getProperty(this->g_vname);
165 pck << property.setType<T>();
166 }
167}
168template<class T>
170{
171 fge::Property& property = this->g_typeSource->getProperty(this->g_vname);
172
173 pck << property.setType<T>();
174}
175
176template<class T>
178{
179 return this->g_typeSource->getProperty(this->g_vname).isModified();
180}
181template<class T>
183{
184 this->g_typeSource->getProperty(this->g_vname).setModifiedFlag(true);
185}
186template<class T>
188{
189 this->g_typeSource->getProperty(this->g_vname).setModifiedFlag(false);
190}
191
192template<class T>
193std::string const& NetworkTypePropertyList<T>::getValueName() const
194{
195 return this->g_vname;
196}
197
199template<class T>
201 g_typeSource(source),
202 g_trigger(false)
203{}
204
205template<class T>
207{
208 return this->g_typeSource;
209}
210
211template<class T>
213{
214 if (pck >> *this->g_typeSource)
215 {
216 this->setLastUpdateTime();
217 this->clearWaitingUpdateFlag();
218 this->_onApplied.call();
219 return true;
220 }
221 return false;
222}
223template<class T>
225{
226 if (this->clearModificationFlag(id))
227 {
228 pck << *this->g_typeSource;
229 }
230}
231template<class T>
233{
234 pck << *this->g_typeSource;
235}
236
237template<class T>
239{
240 return this->g_trigger;
241}
242template<class T>
244{
245 this->g_trigger = true;
246}
247template<class T>
249{
250 this->g_trigger = false;
251}
252
253template<class T>
254void NetworkTypeManual<T>::trigger()
255{
256 this->g_trigger = true;
257}
258
259//RecordedVector
260
261template<class T>
262typename RecordedVector<T>::const_reference RecordedVector<T>::at(SizeType index) const
263{
264 return this->g_container.at(index);
265}
266template<class T>
267typename RecordedVector<T>::const_reference RecordedVector<T>::operator[](SizeType index) const
268{
269 return this->g_container[index];
270}
271template<class T>
272typename RecordedVector<T>::const_reference RecordedVector<T>::front() const
273{
274 return this->g_container.front();
275}
276template<class T>
277typename RecordedVector<T>::const_reference RecordedVector<T>::back() const
278{
279 return this->g_container.back();
280}
281template<class T>
282T const* RecordedVector<T>::data() const
283{
284 return this->g_container.data();
285}
286
287template<class T>
288typename RecordedVector<T>::const_iterator RecordedVector<T>::begin() const
289{
290 return this->g_container.begin();
291}
292template<class T>
293typename RecordedVector<T>::const_iterator RecordedVector<T>::end() const
294{
295 return this->g_container.end();
296}
297template<class T>
298typename RecordedVector<T>::const_iterator RecordedVector<T>::cbegin() const
299{
300 return this->g_container.cbegin();
301}
302template<class T>
303typename RecordedVector<T>::const_iterator RecordedVector<T>::cend() const
304{
305 return this->g_container.cend();
306}
307template<class T>
308typename RecordedVector<T>::const_reverse_iterator RecordedVector<T>::rbegin() const
309{
310 return this->g_container.rbegin();
311}
312template<class T>
313typename RecordedVector<T>::const_reverse_iterator RecordedVector<T>::rend() const
314{
315 return this->g_container.rend();
316}
317template<class T>
318typename RecordedVector<T>::const_reverse_iterator RecordedVector<T>::crbegin() const
319{
320 return this->g_container.crbegin();
321}
322template<class T>
323typename RecordedVector<T>::const_reverse_iterator RecordedVector<T>::crend() const
324{
325 return this->g_container.crend();
326}
327
328template<class T>
329SizeType RecordedVector<T>::size() const
330{
331 return static_cast<SizeType>(this->g_container.size());
332}
333template<class T>
334bool RecordedVector<T>::empty() const
335{
336 return this->g_container.empty();
337}
338
339template<class T>
340void RecordedVector<T>::reserve(SizeType n)
341{
342 this->g_container.reserve(n);
343}
344
345template<class T>
346void RecordedVector<T>::clear()
347{
348 this->g_container.clear();
349 this->clearEvents();
350 this->pushEvent({RecordedEventTypes::REMOVE_ALL, 0});
351}
352template<class T>
353typename RecordedVector<T>::iterator RecordedVector<T>::insert(const_iterator pos, T const& value)
354{
355 SizeType index = pos - this->g_container.begin();
356 this->pushEvent({RecordedEventTypes::ADD, index});
357 return this->g_container.insert(pos, value);
358}
359template<class T>
360typename RecordedVector<T>::iterator RecordedVector<T>::insert(const_iterator pos, T&& value)
361{
362 SizeType index = pos - this->g_container.begin();
363 this->pushEvent({RecordedEventTypes::ADD, index});
364 return this->g_container.insert(pos, std::move(value));
365}
366template<class T>
367template<class... TArgs>
368typename RecordedVector<T>::iterator RecordedVector<T>::emplace(const_iterator pos, TArgs&&... value)
369{
370 SizeType index = pos - this->g_container.begin();
371 this->pushEvent({RecordedEventTypes::ADD, index});
372 return this->g_container.emplace(pos, std::forward<TArgs>(value)...);
373}
374template<class T>
375template<class TArg>
376void RecordedVector<T>::push_back(TArg&& arg)
377{
378 this->pushEvent({RecordedEventTypes::ADD, this->g_container.size()});
379 this->g_container.push_back(std::forward<TArg>(arg));
380}
381template<class T>
382template<class... TArgs>
383typename RecordedVector<T>::reference RecordedVector<T>::emplace_back(TArgs&&... arg)
384{
385 this->pushEvent({RecordedEventTypes::ADD, this->g_container.size()});
386 return this->g_container.emplace_back(std::forward<TArgs>(arg)...);
387}
388template<class T>
389typename RecordedVector<T>::const_iterator RecordedVector<T>::erase(const_iterator pos)
390{
391 SizeType index = pos - this->g_container.begin();
392 this->pushEvent({RecordedEventTypes::REMOVE, index});
393 return this->g_container.erase(pos);
394}
395template<class T>
396void RecordedVector<T>::pop_back()
397{
398 this->pushEvent({RecordedEventTypes::REMOVE, this->g_container.size() - 1});
399 this->g_container.pop_back();
400}
401
402template<class T>
403typename RecordedVector<T>::reference RecordedVector<T>::modify(SizeType index)
404{
405 this->pushEvent({RecordedEventTypes::MODIFY, index});
406 return this->g_container[index];
407}
408template<class T>
409typename RecordedVector<T>::reference RecordedVector<T>::modify(const_iterator pos)
410{
411 SizeType index = pos - this->g_container.begin();
412 this->pushEvent({RecordedEventTypes::MODIFY, index});
413 return this->g_container[index];
414}
415
416template<class T>
417void RecordedVector<T>::clearEvents()
418{
419 this->g_events.clear();
420}
421template<class T>
422SizeType RecordedVector<T>::eventsSize() const
423{
424 return static_cast<SizeType>(this->g_events.size());
425}
426template<class T>
427typename RecordedVector<T>::EventQueue const& RecordedVector<T>::getEventQueue() const
428{
429 return this->g_events;
430}
431
432template<class T>
433bool RecordedVector<T>::isRegisteringEvents() const
434{
435 return this->g_registerEvents;
436}
437template<class T>
438void RecordedVector<T>::registerEvents(bool enable)
439{
440 this->clearEvents();
441 this->g_registerEvents = enable;
442}
443
444template<class T>
445void RecordedVector<T>::pushEvent(RecordedEvent event)
446{
447 if (this->g_registerEvents)
448 {
449 this->g_events.emplace_back(event);
450 }
451}
452
453template<class T>
454Packet& operator<<(Packet& pck, RecordedVector<T> const& vec)
455{
456 return pck << vec.g_container;
457}
458template<class T>
459Packet const& operator>>(Packet const& pck, RecordedVector<T>& vec)
460{
461 return pck >> vec.g_container;
462}
463inline Packet& operator<<(Packet& pck, RecordedEvent const& event)
464{
465 return pck << event._type << event._index;
466}
467inline Packet const& operator>>(Packet const& pck, RecordedEvent& event)
468{
469 return pck >> event._type >> event._index;
470}
471
472//NetworkTypeVector
473
474template<class T>
475NetworkTypeVector<T>::NetworkTypeVector(RecordedVector<T>* source) :
476 g_typeSource(source)
477{}
478
479template<class T>
481{
482 return this->g_typeSource;
483}
484
485template<class T>
487{
488 PackTypes packType;
489 pck >> packType;
490
491 if (packType == PackTypes::FULL)
492 {
493 pck >> *this->g_typeSource;
494 }
495 else
496 {
497 SizeType eventCount{0};
498 pck >> eventCount;
499 for (SizeType i = 0; i < eventCount; ++i)
500 {
501 RecordedEvent event{};
502 pck >> event;
503 switch (event._type)
504 {
505 case RecordedEventTypes::ADD:
506 if (event._index >= this->g_typeSource->size())
507 {
508 T value;
509 pck >> value;
510 this->g_typeSource->emplace_back(std::move(value));
511 }
512 else
513 {
514 T value;
515 pck >> value;
516 this->g_typeSource->emplace(this->g_typeSource->begin() + event._index, std::move(value));
517 }
518 break;
519 case RecordedEventTypes::REMOVE:
520 if (event._index < this->g_typeSource->size())
521 {
522 this->g_typeSource->erase(this->g_typeSource->begin() + event._index);
523 }
524 else
525 {
526 return false;
527 }
528 break;
529 case RecordedEventTypes::REMOVE_ALL:
530 this->g_typeSource->clear();
531 break;
532 case RecordedEventTypes::MODIFY:
533 if (event._index < this->g_typeSource->size())
534 {
535 pck >> this->g_typeSource->modify(event._index);
536 }
537 else
538 {
539 return false;
540 }
541 break;
542 }
543 }
544 }
545
546 this->setLastUpdateTime();
547 this->clearWaitingUpdateFlag();
548 this->_onApplied.call();
549 return true;
550}
551template<class T>
553{
554 auto* clientData = this->getClientData(id);
555
556 if (clientData == nullptr)
557 {
558 return;
559 }
560
561 auto* events = static_cast<typename RecordedVector<T>::EventQueue*>(clientData->_data.get());
562
563 if (events->empty())
564 { //Events queue is empty but the modified flag is set, that means we have to send the full vector
565 pck << PackTypes::FULL;
566 pck << *this->g_typeSource;
567 }
568 else
569 {
570 pck << PackTypes::PARTIAL;
571 pck << static_cast<SizeType>(events->size());
572 for (auto itEvent = events->begin(); itEvent != events->end(); ++itEvent)
573 {
574 pck << *itEvent;
575 if (itEvent->_type == RecordedEventTypes::ADD || itEvent->_type == RecordedEventTypes::MODIFY)
576 {
577 //We have to pack the data but the index do not represent the current state of the vector.
578 //So we have to reverse read the events (history) to get the correct index.
579 auto finalIndex = itEvent->_index;
580 for (auto itReverse = events->rbegin(); &(*itReverse) != &(*itEvent); ++itReverse)
581 {
582 if (itReverse->_type == RecordedEventTypes::ADD && itReverse->_index <= finalIndex)
583 {
584 ++finalIndex;
585 }
586 else if (itReverse->_type == RecordedEventTypes::REMOVE && itReverse->_index < finalIndex)
587 {
588 --finalIndex;
589 }
590 }
591 pck << this->g_typeSource->at(finalIndex);
592 }
593 }
594 events->clear();
595 }
596
597 clientData->_config.unset(CLIENTCONFIG_MODIFIED_FLAG);
598}
599template<class T>
601{
602 pck << PackTypes::FULL << *this->g_typeSource;
603}
604
605template<class T>
607{
608 auto* clientData = this->getClientData(id);
609 if (clientData != nullptr)
610 {
611 clientData->_config.set(CLIENTCONFIG_MODIFIED_FLAG);
612 auto* events = static_cast<typename RecordedVector<T>::EventQueue*>(clientData->_data);
613 events->clear();
614 }
615}
616template<class T>
618{
619 auto* clientData = this->getClientData(id);
620 if (clientData != nullptr)
621 {
622 clientData->_config.unset(CLIENTCONFIG_MODIFIED_FLAG);
623 auto* events = static_cast<typename RecordedVector<T>::EventQueue*>(clientData->_data);
624 events->clear();
625 }
626}
627
628template<class T>
630{
631 if (this->_g_force)
632 { //When events is cleared, we send the full vector
633 this->g_typeSource->clearEvents();
634 }
635 return this->g_typeSource->eventsSize() != 0 || this->_g_force;
636}
637template<class T>
639{
640 this->_g_force = true;
641}
642template<class T>
644{
645 this->_g_force = false;
646 this->g_typeSource->clearEvents();
647}
648
649template<class T>
650void NetworkTypeVector<T>::createClientData(std::shared_ptr<void>& ptr) const
651{
652 ptr = std::shared_ptr<void>(new typename RecordedVector<T>::EventQueue(),
654}
655template<class T>
656void NetworkTypeVector<T>::applyClientData(std::shared_ptr<void>& ptr) const
657{
658 auto* events = static_cast<typename RecordedVector<T>::EventQueue*>(ptr);
659
660 bool const clearFirst = this->g_typeSource->getEventQueue().front()._type == RecordedEventTypes::REMOVE_ALL;
661 if (clearFirst)
662 {
663 events->clear();
664 }
665
666 for (auto const& event: this->g_typeSource->getEventQueue())
667 {
668 events->push_back(event);
669 }
670}
671
672//NetworkTypeEvents
673
674template<class TEnum, class TData>
676{
677 return nullptr; //This type does not have a source, it is a collection of events
678}
679
680template<class TEnum, class TData>
682{
683 SizeType eventCount{0};
684 pck >> eventCount;
685
686 if (eventCount == 0)
687 {
688 return true; //Nothing to apply
689 }
690
691 for (SizeType i = 0; i < eventCount; ++i)
692 {
693 TEnum eventType{};
694 pck >> eventType;
695 if constexpr (std::is_void_v<TData>)
696 {
697 this->_onEvent.call(eventType);
698 }
699 else
700 {
701 TData eventData{};
702 pck >> eventData;
703 this->_onEvent.call(std::make_pair(eventType, std::move(eventData)));
704 }
705 }
706
707 this->setLastUpdateTime();
708 this->clearWaitingUpdateFlag();
709 this->_onApplied.call();
710 return true;
711}
712template<class TEnum, class TData>
714{
715 auto* clientData = this->getClientData(id);
716
717 if (clientData == nullptr)
718 {
719 return;
720 }
721
722 auto* events = static_cast<EventQueue*>(clientData->_data.get());
723
724 pck << static_cast<SizeType>(events->size());
725
726 for (auto const& event: *events)
727 {
728 if constexpr (std::is_void_v<TData>)
729 {
730 pck << event;
731 }
732 else
733 {
734 pck << event.first << event.second;
735 }
736 }
737 events->clear();
738
739 clientData->_config.unset(CLIENTCONFIG_MODIFIED_FLAG);
740}
741template<class TEnum, class TData>
743{
744 //This type does not have a source, it is a collection of events
745 pck << SizeType{0};
746}
747
748template<class TEnum, class TData>
750{
751 auto* clientData = this->getClientData(id);
752 if (clientData != nullptr)
753 {
754 clientData->_config.set(CLIENTCONFIG_MODIFIED_FLAG);
755 }
756}
757template<class TEnum, class TData>
759{
760 auto* clientData = this->getClientData(id);
761 if (clientData != nullptr)
762 {
763 clientData->_config.unset(CLIENTCONFIG_MODIFIED_FLAG);
764 auto* events = static_cast<EventQueue*>(clientData->_data.get());
765 events->clear();
766 }
767}
768
769template<class TEnum, class TData>
771{
772 return this->g_modified || this->_g_force;
773}
774template<class TEnum, class TData>
776{
777 this->_g_force = true;
778}
779template<class TEnum, class TData>
781{
782 this->_g_force = false;
783 this->g_modified = false;
784}
785
786template<class TEnum, class TData>
787void NetworkTypeEvents<TEnum, TData>::pushEvent(Event const& event)
788{
789 this->g_modified = true;
790 for (auto& client: *this)
791 {
792 auto* events = static_cast<EventQueue*>(client.second._data.get());
793 events->push_back(event);
794 client.second._config.set(CLIENTCONFIG_MODIFIED_FLAG);
795 }
796}
797template<class TEnum, class TData>
798void NetworkTypeEvents<TEnum, TData>::pushEventIgnore(Event const& event, Identity const& ignoreId)
799{
800 this->g_modified = true;
801 for (auto& client: *this)
802 {
803 if (client.first == ignoreId)
804 {
805 continue; //Skip the ignored client
806 }
807
808 auto* events = static_cast<EventQueue*>(client.second._data.get());
809 events->push_back(event);
810 client.second._config.set(CLIENTCONFIG_MODIFIED_FLAG);
811 }
812}
813
814template<class TEnum, class TData>
815void NetworkTypeEvents<TEnum, TData>::createClientData(std::shared_ptr<void>& ptr) const
816{
817 ptr = std::shared_ptr<void>(new EventQueue(), NetworkTypeEvents::DataDeleter());
818}
819template<class TEnum, class TData>
820void NetworkTypeEvents<TEnum, TData>::applyClientData([[maybe_unused]] std::shared_ptr<void>& ptr) const
821{}
822
823} // namespace fge::net
This class is a wrapper for SDL events.
Definition C_event.hpp:59
A class that map a string to a Property.
Definition C_propertyList.hpp:35
A class that can store any type of data.
Definition C_property.hpp:54
fge::CallbackHandler _onApplied
Callback called when the value have been applied.
Definition C_networkType.hpp:250
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:713
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:681
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:775
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:770
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:675
void forceUncheckClient(Identity const &id) override
Reset the modification flag for the specified client identity.
Definition C_networkType.inl:758
void forceCheckClient(Identity const &id) override
Force the modification flag to be set for the specified client identity.
Definition C_networkType.inl:749
fge::CallbackHandler< Event > _onEvent
Callback called when an event is received.
Definition C_networkType.hpp:665
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:780
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:206
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:243
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:248
NetworkTypeManual(T *source)
NetworkTypeManual.
Definition C_networkType.inl:200
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:212
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:224
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:238
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:142
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:177
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:187
NetworkTypePropertyList(fge::PropertyList *source, std::string const &vname)
NetworkTypePropertyList.
Definition C_networkType.inl:133
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:148
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:182
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:160
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:102
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:126
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:121
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:86
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:92
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:116
NetworkTypeProperty(fge::Property *source)
NetworkTypeProperty.
Definition C_networkType.inl:79
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:638
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:552
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:643
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:480
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:486
void forceCheckClient(Identity const &id) override
Force the modification flag to be set for the specified client identity.
Definition C_networkType.inl:606
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:629
void forceUncheckClient(Identity const &id) override
Reset the modification flag for the specified client identity.
Definition C_networkType.inl:617
NetworkType(fge::DataAccessor< T > source)
NetworkType.
Definition C_networkType.inl:23
void packData(Packet &pck, Identity const &id) override
Pack the data into a packet and reset the modification flag of the identity.
Definition C_networkType.inl:47
void forceCheck() override
Force the value to be modified (even if it is not)
Definition C_networkType.inl:65
void forceUncheck() override
Remove the forced modification of the value.
Definition C_networkType.inl:70
bool applyData(Packet const &pck) override
Apply the data packed by the same network type from a server.
Definition C_networkType.inl:34
void const * getSource() const override
Get the source pointer that have been used to create this network type.
Definition C_networkType.inl:29
bool check() const override
Check if the value have been modified.
Definition C_networkType.inl:60
Definition C_packet.hpp:52
Definition C_networkType.hpp:523
Definition C_dataAccessor.hpp:27
A class to represent a client or server identity with an IP address and a port.
Definition C_identity.hpp:31
Definition C_networkType.hpp:513