You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
737 B
46 lines
737 B
#import "PlayerBase.h"
|
|
|
|
@implementation PlayerState
|
|
|
|
- (id)init
|
|
{
|
|
self = [super init];
|
|
_state = Empty;
|
|
_valueFloat = -1;
|
|
_valueLong = -1;
|
|
_valueString = nil;
|
|
|
|
return self;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation NSMutableArray (QueueStack)
|
|
-(PlayerState*)queuePop {
|
|
@synchronized(self)
|
|
{
|
|
if ([self count] == 0)
|
|
return nil;
|
|
|
|
PlayerState *queueObject = (PlayerState*)[self objectAtIndex:0];
|
|
[self removeObjectAtIndex:0];
|
|
|
|
return queueObject;
|
|
}
|
|
}
|
|
|
|
-(void)queuePush:(PlayerState*)anObject {
|
|
@synchronized(self)
|
|
{
|
|
[self addObject:anObject];
|
|
}
|
|
}
|
|
|
|
-(void)clear {
|
|
@synchronized(self)
|
|
{
|
|
[self removeAllObjects];
|
|
}
|
|
}
|
|
@end
|