private void UnBindModAsProxy(ref ItemRepresentation.ItemModPair pair) { if ((int)pair.bindState == 2) { pair.dataBlock.UnBindAsProxy(pair.representation); pair.bindState = ItemRepresentation.BindState.None; } }
private void BindModAsProxy(ref ItemRepresentation.ItemModPair pair) { if ((int)pair.bindState == 1) { pair.dataBlock.BindAsProxy(pair.representation); pair.bindState = ItemRepresentation.BindState.World; } }
private void UnBindModAsLocal(ref ItemRepresentation.ItemModPair pair, ref ModViewModelRemoveArgs a) { if ((int)pair.bindState == 3) { a.modRep = pair.representation; pair.dataBlock.UnBindAsLocal(ref a); pair.bindState = ItemRepresentation.BindState.None; } }
private static bool KillModForRep(ref ItemRepresentation.ItemModPair pair, ItemModRepresentation modRep, ItemRepresentation owner, bool fromCallback) { if (pair.representation != modRep) { return(true); } owner.KillModRep(ref pair.representation, fromCallback); return(true); }
private void BindModAsLocal(ref ItemRepresentation.ItemModPair pair, ref ModViewModelAddArgs a) { if ((int)pair.bindState == 2) { this.UnBindModAsProxy(ref pair); } if ((int)pair.bindState == 1 || (int)pair.bindState == 3) { a.modRep = pair.representation; pair.dataBlock.BindAsLocal(ref a); pair.bindState = ItemRepresentation.BindState.Local; } }
protected virtual void StateSignalReceive(Character character, bool treatedAsFirst) { CharacterStateFlags characterStateFlag = character.stateFlags; if (this.lastCharacterStateFlags.HasValue && this.lastCharacterStateFlags.Value.Equals(characterStateFlag)) { return; } this.lastCharacterStateFlags = new CharacterStateFlags?(characterStateFlag); for (int i = 0; i < 5; i++) { if (this._itemMods[i].representation) { ItemRepresentation.ItemModPair item = this._itemMods[i]; item.representation.HandleChangedStateFlags(characterStateFlag, !treatedAsFirst); } } }
private void InstallMod(ref ItemRepresentation.ItemModPair to, int slot, ItemModDataBlock datablock, CharacterStateFlags flags) { to.dataBlock = datablock; if (to.representation) { this.KillModRep(ref to.representation, false); } if (to.dataBlock.hasModRepresentation && to.dataBlock.AddModRepresentationComponent(base.gameObject, out to.representation)) { to.bindState = ItemRepresentation.BindState.None; to.representation.Initialize(this, slot, flags); if (!to.representation) { to.bindState = ItemRepresentation.BindState.Vacant; to.representation = null; } else if (this.worldModels) { this._itemMods.BindAsProxy(slot, this); } } }
public ItemRepresentation.ItemModPair this[int slotNumber] { get { switch (slotNumber) { case 0: { return(this.a); } case 1: { return(this.b); } case 2: { return(this.c); } case 3: { return(this.d); } case 4: { return(this.e); } } throw new IndexOutOfRangeException(); } set { switch (slotNumber) { case 0: { this.a = value; break; } case 1: { this.b = value; break; } case 2: { this.c = value; break; } case 3: { this.d = value; break; } case 4: { this.e = value; break; } default: { throw new IndexOutOfRangeException(); } } } }
private void ClearModPair(ref ItemRepresentation.ItemModPair pair) { this.KillModRep(ref pair.representation, false); this.EraseModDatablock(ref pair.dataBlock); pair = new ItemRepresentation.ItemModPair(); }