bsnes/hiro/core/group.cpp
Tim Allen 20cc6148cb Update to v094r27 release.
byuu says:

Added AWJ's fixes for alt/cpu (Tetris Attack framelines issue) and
alt/dsp (Thread::clock reset)

Added fix so that the taskbar entry appears when the application first
starts on Windows.

Fixed checkbox toggling inside of list views on Windows.

Updated nall/image to properly protect variables that should not be
written externally.

New Object syntax for hiro is in.

Fixed the backwards-typing on Windows with the state manager.
NOTE: the list view isn't redrawing when you change the description
text. It does so on the cheat editor because of the resizeColumns call;
but that shouldn't be necessary. I'll try and fix this for the next WIP.
2015-06-18 20:48:53 +10:00

44 lines
845 B
C++

#if defined(Hiro_Group)
auto mGroup::allocate() -> pObject* {
return new pGroup(*this);
}
//
auto mGroup::append(sObject object) -> type& {
if(auto group = instance.acquire()) {
state.objects.append(object);
object->setGroup(group);
}
return *this;
}
auto mGroup::object(unsigned position) const -> Object {
if(position < state.objects.size()) {
if(auto object = state.objects[position].acquire()) {
return object;
}
}
return {};
}
auto mGroup::objects() const -> unsigned {
return state.objects.size();
}
auto mGroup::remove(sObject object) -> type& {
object->setGroup();
for(auto offset : range(state.objects)) {
if(auto shared = state.objects[offset].acquire()) {
if(object == shared) {
state.objects.remove(offset);
break;
}
}
}
return *this;
}
#endif