mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 17:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,83 @@
|
||||
package avatar
|
||||
{
|
||||
public class UserVarCache
|
||||
{
|
||||
|
||||
private var _cache:Object;
|
||||
|
||||
public function UserVarCache()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
this._cache = new Object();
|
||||
}
|
||||
|
||||
public function set playerUserVars(param1:Object) : void
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
this._cache = new Object();
|
||||
for(_loc2_ in param1)
|
||||
{
|
||||
this._cache[_loc2_] = {
|
||||
"value":param1[_loc2_].value,
|
||||
"type":param1[_loc2_].type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public function get playerUserVars() : Object
|
||||
{
|
||||
return this._cache;
|
||||
}
|
||||
|
||||
public function getUserVarValueById(param1:int) : int
|
||||
{
|
||||
if(Boolean(this._cache) && Boolean(this._cache[param1]))
|
||||
{
|
||||
return this._cache[param1].value;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function getUserVarTypeById(param1:int) : int
|
||||
{
|
||||
if(Boolean(this._cache) && Boolean(this._cache[param1]))
|
||||
{
|
||||
return this._cache[param1].type;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public function isBitSet(param1:int, param2:int) : Boolean
|
||||
{
|
||||
if(Boolean(this._cache) && Boolean(this._cache[param1]))
|
||||
{
|
||||
return Boolean(this._cache[param1].value & 1 << param2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function updateUserVar(param1:int, param2:int, param3:int = -1) : void
|
||||
{
|
||||
if(!this._cache)
|
||||
{
|
||||
this._cache = new Object();
|
||||
}
|
||||
if(this._cache[param1])
|
||||
{
|
||||
this._cache[param1].value = param2;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._cache[param1] = {
|
||||
"value":param2,
|
||||
"type":param3
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user