mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-26 01:37:08 +00:00
refactor: begin unglobbing std::vector
This commit is contained in:
@@ -16,7 +16,7 @@ SimpleContainer::SimpleContainer(int name, int size)
|
||||
|
||||
void SimpleContainer::addListener(net_minecraft_world::ContainerListener *listener)
|
||||
{
|
||||
if (listeners == NULL) listeners = new vector<net_minecraft_world::ContainerListener *>();
|
||||
if (listeners == NULL) listeners = new std::vector<net_minecraft_world::ContainerListener *>();
|
||||
listeners->push_back(listener);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ void SimpleContainer::removeListener(net_minecraft_world::ContainerListener *lis
|
||||
// 4J Java has a remove function on lists that will find the first occurence of
|
||||
// an object and remove it. We need to replicate that ourselves
|
||||
|
||||
vector<net_minecraft_world::ContainerListener *>::iterator it = listeners->begin();
|
||||
vector<net_minecraft_world::ContainerListener *>::iterator itEnd = listeners->end();
|
||||
std::vector<net_minecraft_world::ContainerListener *>::iterator it = listeners->begin();
|
||||
std::vector<net_minecraft_world::ContainerListener *>::iterator itEnd = listeners->end();
|
||||
while( it != itEnd && *it != listener )
|
||||
it++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user