mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -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,103 @@
|
||||
package inventory
|
||||
{
|
||||
import currency.CombinedCurrencyItem;
|
||||
import diamond.DiamondItem;
|
||||
import flash.display.Sprite;
|
||||
|
||||
public interface Iitem
|
||||
{
|
||||
|
||||
function get layerId() : int;
|
||||
|
||||
function get invIdx() : int;
|
||||
|
||||
function get name() : String;
|
||||
|
||||
function get isMemberOnly() : Boolean;
|
||||
|
||||
function set isMemberOnly(param1:Boolean) : void;
|
||||
|
||||
function get enviroType() : int;
|
||||
|
||||
function get recycleValue() : int;
|
||||
|
||||
function get currencyType() : int;
|
||||
|
||||
function get endTime() : uint;
|
||||
|
||||
function set endTime(param1:uint) : void;
|
||||
|
||||
function get startTime() : uint;
|
||||
|
||||
function get itemStatus() : int;
|
||||
|
||||
function get value() : *;
|
||||
|
||||
function get defId() : int;
|
||||
|
||||
function set defId(param1:int) : void;
|
||||
|
||||
function get icon() : Sprite;
|
||||
|
||||
function get largeIcon() : Sprite;
|
||||
|
||||
function get isShopItem() : Boolean;
|
||||
|
||||
function get combinedCurrencyItem() : CombinedCurrencyItem;
|
||||
|
||||
function get isIconLoaded() : Boolean;
|
||||
|
||||
function get imageLoadedCallback() : Function;
|
||||
|
||||
function set imageLoadedCallback(param1:Function) : void;
|
||||
|
||||
function destroy() : void;
|
||||
|
||||
function clone() : Iitem;
|
||||
|
||||
function ifItemDiffers(param1:Iitem) : Boolean;
|
||||
|
||||
function get isOnSale() : Boolean;
|
||||
|
||||
function get isOnClearance() : Boolean;
|
||||
|
||||
function get isRare() : Boolean;
|
||||
|
||||
function get isNew() : Boolean;
|
||||
|
||||
function get isOcean() : Boolean;
|
||||
|
||||
function get isLand() : Boolean;
|
||||
|
||||
function get isLandAndOcean() : Boolean;
|
||||
|
||||
function get isDiamond() : Boolean;
|
||||
|
||||
function get isRareDiamond() : Boolean;
|
||||
|
||||
function get isApproved() : Boolean;
|
||||
|
||||
function set isApproved(param1:Boolean) : void;
|
||||
|
||||
function get isCustom() : Boolean;
|
||||
|
||||
function updateValueWithNewStatus(param1:int) : void;
|
||||
|
||||
function set diamondItem(param1:DiamondItem) : void;
|
||||
|
||||
function get diamondItem() : DiamondItem;
|
||||
|
||||
function get isAvailable() : Boolean;
|
||||
|
||||
function get isInDenShop() : Boolean;
|
||||
|
||||
function get denStoreInvId() : int;
|
||||
|
||||
function set denStoreInvId(param1:int) : void;
|
||||
|
||||
function get itemType() : int;
|
||||
|
||||
function set asShopItemSized(param1:Boolean) : void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package inventory
|
||||
{
|
||||
import avatar.AccessoryState;
|
||||
import collection.AccItemCollection;
|
||||
import collection.IitemCollection;
|
||||
|
||||
public class InventoryAccessoryItem extends InventoryBase
|
||||
{
|
||||
|
||||
public function InventoryAccessoryItem()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init(param1:AccessoryState, param2:IitemCollection = null) : void
|
||||
{
|
||||
super.init(param1,new AccItemCollection());
|
||||
}
|
||||
|
||||
public function get itemCollection() : AccItemCollection
|
||||
{
|
||||
if(_itemCollection)
|
||||
{
|
||||
return _itemCollection as AccItemCollection;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function set itemCollection(param1:AccItemCollection) : void
|
||||
{
|
||||
if(param1 != null)
|
||||
{
|
||||
super.itemArrayBase = param1 as IitemCollection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
package inventory
|
||||
{
|
||||
import avatar.AccessoryState;
|
||||
import collection.IitemCollection;
|
||||
import collection.IntItemCollection;
|
||||
import item.Item;
|
||||
|
||||
public class InventoryBase
|
||||
{
|
||||
|
||||
protected var _itemCollection:IitemCollection;
|
||||
|
||||
protected var _accState:AccessoryState;
|
||||
|
||||
private var _indexedItemCollection:IntItemCollection;
|
||||
|
||||
public function InventoryBase()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:AccessoryState, param2:IitemCollection = null) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
_accState = param1;
|
||||
_itemCollection = param2;
|
||||
_indexedItemCollection = new IntItemCollection();
|
||||
if(_itemCollection && _itemCollection.length > 0)
|
||||
{
|
||||
_loc3_ = 0;
|
||||
while(_loc3_ < _itemCollection.length)
|
||||
{
|
||||
_indexedItemCollection.setIntItem(_itemCollection.getIitem(_loc3_).invIdx,_loc3_);
|
||||
_loc3_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
var _loc1_:int = 0;
|
||||
if(_itemCollection)
|
||||
{
|
||||
_loc1_ = 0;
|
||||
while(_loc1_ < _itemCollection.length)
|
||||
{
|
||||
_itemCollection.getIitem(_loc1_).destroy();
|
||||
_loc1_++;
|
||||
}
|
||||
_itemCollection = null;
|
||||
_indexedItemCollection = null;
|
||||
}
|
||||
if(_accState)
|
||||
{
|
||||
_accState.destroy();
|
||||
_accState = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function eraseAll() : void
|
||||
{
|
||||
_itemCollection = new IitemCollection();
|
||||
_indexedItemCollection = new IntItemCollection();
|
||||
}
|
||||
|
||||
public function clone(param1:InventoryBase) : void
|
||||
{
|
||||
_itemCollection = new IitemCollection();
|
||||
_indexedItemCollection = new IntItemCollection();
|
||||
_accState = param1._accState;
|
||||
var _loc3_:IitemCollection = param1._itemCollection;
|
||||
for each(var _loc2_:Iitem in _loc3_.getCoreArray())
|
||||
{
|
||||
addItem(_loc2_.clone());
|
||||
}
|
||||
}
|
||||
|
||||
public function addItem(param1:Iitem) : void
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
var _loc2_:int = 0;
|
||||
if(_itemCollection != null)
|
||||
{
|
||||
if(getItemIndexInItemArray(param1.invIdx) >= 0)
|
||||
{
|
||||
_loc3_ = int(_itemCollection.length);
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
if(_itemCollection.getIitem(_loc2_).ifItemDiffers(param1))
|
||||
{
|
||||
updateItem(param1);
|
||||
break;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemCollection.pushIitem(param1);
|
||||
_indexedItemCollection.setIntItem(param1.invIdx,_itemCollection.length - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_itemCollection.pushIitem(param1);
|
||||
_indexedItemCollection.setIntItem(param1.invIdx,_itemCollection.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeItem(param1:Iitem) : void
|
||||
{
|
||||
var _loc2_:int = getItemIndexInItemArray(param1.invIdx);
|
||||
if(_loc2_ >= 0)
|
||||
{
|
||||
_itemCollection.getCoreArray().splice(_loc2_,1);
|
||||
_indexedItemCollection.getCoreArray().splice(param1.invIdx,1);
|
||||
}
|
||||
}
|
||||
|
||||
private function updateItem(param1:Iitem) : void
|
||||
{
|
||||
var _loc2_:int = getItemIndexInItemArray(param1.invIdx);
|
||||
if(_loc2_ >= 0)
|
||||
{
|
||||
if(_accState != null)
|
||||
{
|
||||
_accState.replaceAccessory(_itemCollection.getIitem(_loc2_) as Item,param1 as Item);
|
||||
}
|
||||
_itemCollection.setIitem(_loc2_,param1);
|
||||
return;
|
||||
}
|
||||
throw new Error("WARNING: Inventory- Cannot update an item that doesn\'t exist in inventory.");
|
||||
}
|
||||
|
||||
public function hasItem(param1:Iitem) : Boolean
|
||||
{
|
||||
if(getItemIndexInItemArray(param1.invIdx) >= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function get itemArrayBase() : IitemCollection
|
||||
{
|
||||
return _itemCollection;
|
||||
}
|
||||
|
||||
protected function set itemArrayBase(param1:IitemCollection) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
_itemCollection = param1;
|
||||
_indexedItemCollection = new IntItemCollection();
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _itemCollection.length)
|
||||
{
|
||||
_itemCollection.setIitem(_loc2_,_itemCollection.getIitem(_loc2_).clone());
|
||||
_indexedItemCollection.setIntItem(_itemCollection.getIitem(_loc2_).invIdx,_loc2_);
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get numItems() : int
|
||||
{
|
||||
return _itemCollection.length;
|
||||
}
|
||||
|
||||
private function getItemIndexInItemArray(param1:int) : int
|
||||
{
|
||||
if(_indexedItemCollection.hasIntItem(param1))
|
||||
{
|
||||
return _indexedItemCollection.getIntItem(param1);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package inventory
|
||||
{
|
||||
import avatar.AccessoryState;
|
||||
import collection.DenItemCollection;
|
||||
import collection.IitemCollection;
|
||||
|
||||
public class InventoryDenItem extends InventoryBase
|
||||
{
|
||||
|
||||
public function InventoryDenItem()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init(param1:AccessoryState, param2:IitemCollection = null) : void
|
||||
{
|
||||
super.init(param1,new DenItemCollection());
|
||||
}
|
||||
|
||||
public function get denItemCollection() : DenItemCollection
|
||||
{
|
||||
if(_itemCollection)
|
||||
{
|
||||
return _itemCollection as DenItemCollection;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function set denItemCollection(param1:DenItemCollection) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
super.itemArrayBase = param1 as IitemCollection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user