public CCBReader(CCBReader reader) { mCurrentByte = -1; mCurrentBit = -1; mLoadedSpriteSheets = reader.mLoadedSpriteSheets; mCCNodeLoaderLibrary = reader.mCCNodeLoaderLibrary; mCCBMemberVariableAssigner = reader.mCCBMemberVariableAssigner; mCCBSelectorResolver = reader.mCCBSelectorResolver; mCCNodeLoaderListener = reader.mCCNodeLoaderListener; }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, CCBMemberVariableAssigner memberVariableAssigner, CCBSelectorResolver selectorResolver, CCNodeLoaderListener nodeLoaderListener) { mCurrentByte = -1; mCurrentBit = -1; mLoadedSpriteSheets = new List <string>(); mCCNodeLoaderLibrary = nodeLoaderLibrary; mCCBMemberVariableAssigner = memberVariableAssigner; mCCBSelectorResolver = selectorResolver; mCCNodeLoaderListener = nodeLoaderListener; }
public CCBReader(CCBReader reader) { mCurrentByte = -1; mCurrentBit = -1; mLoadedSpriteSheets = reader.mLoadedSpriteSheets; mCCNodeLoaderLibrary = reader.mCCNodeLoaderLibrary; mCCBMemberVariableAssigner = reader.mCCBMemberVariableAssigner; mCCBSelectorResolver = reader.mCCBSelectorResolver; mCCNodeLoaderListener = reader.mCCNodeLoaderListener; }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, CCBMemberVariableAssigner memberVariableAssigner, CCBSelectorResolver selectorResolver, CCNodeLoaderListener nodeLoaderListener) { mCurrentByte = -1; mCurrentBit = -1; mLoadedSpriteSheets = new List<string>(); mCCNodeLoaderLibrary = nodeLoaderLibrary; mCCBMemberVariableAssigner = memberVariableAssigner; mCCBSelectorResolver = selectorResolver; mCCNodeLoaderListener = nodeLoaderListener; }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, CCBMemberVariableAssigner memberVariableAssigner, CCBSelectorResolver selectorResolver) : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null) { }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, CCBMemberVariableAssigner memberVariableAssigner, CCBSelectorResolver selectorResolver) : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null) { }
protected virtual BlockCCControlData ParsePropTypeBlockCcControl(CCNode node, CCNode parent, CCBReader reader) { string selectorName = reader.ReadCachedString(); var selectorTarget = (CCBTargetType)reader.ReadInt(false); var controlEvents = (CCControlEvent)reader.ReadInt(false); if (selectorTarget != CCBTargetType.None) { object target = null; if (selectorTarget == CCBTargetType.DocumentRoot) { target = reader.AnimationManager.RootNode; } else if (selectorTarget == CCBTargetType.Owner) { target = reader.Owner; } if (target != null) { if (selectorName.Length > 0) { SEL_CCControlHandler selCCControlHandler = null; var targetAsCCBSelectorResolver = target as CCBSelectorResolver; if (targetAsCCBSelectorResolver != null) { selCCControlHandler = targetAsCCBSelectorResolver.OnResolveCCBCCControlSelector(target, selectorName); } if (selCCControlHandler == null) { CCBSelectorResolver ccbSelectorResolver = reader.SelectorResolver; if (ccbSelectorResolver != null) { selCCControlHandler = ccbSelectorResolver.OnResolveCCBCCControlSelector(target, selectorName); } } if (selCCControlHandler == null) { CCLog.Log("Skipping selector '{0}' since no CCBSelectorResolver is present.", selectorName); } else { var blockCCControlData = new BlockCCControlData(); blockCCControlData.mSELCCControlHandler = selCCControlHandler; blockCCControlData.mTarget = target; blockCCControlData.mControlEvents = controlEvents; return(blockCCControlData); } } else { CCLog.Log("Unexpected empty selector."); } } else { CCLog.Log("Unexpected NULL target for selector."); } } return(null); }
protected virtual BlockData ParsePropTypeBlock(CCNode node, CCNode parent, CCBReader reader) { string selectorName = reader.ReadCachedString(); var selectorTarget = (CCBTargetType)reader.ReadInt(false); if (selectorTarget != CCBTargetType.None) { object target = null; if (selectorTarget == CCBTargetType.DocumentRoot) { target = reader.AnimationManager.RootNode; } else if (selectorTarget == CCBTargetType.Owner) { target = reader.Owner; /* Scripting specific code because selector function is common for all callbacks. * So if we had 1 target and 1 selector function, the context (callback function name) * would get lost. Hence the need for a new target for each callback. */ if (reader.hasScriptingOwner) { var proxy = (CCBScriptOwnerProtocol)reader.Owner; if (proxy != null) { target = proxy.CreateNew() as object; } } } if (target != null) { if (selectorName.Length > 0) { SEL_MenuHandler selMenuHandler = null; var targetAsCCBSelectorResolver = target as CCBSelectorResolver; if (targetAsCCBSelectorResolver != null) { selMenuHandler = targetAsCCBSelectorResolver.OnResolveCCBCCMenuItemSelector(target, selectorName); } if (selMenuHandler == null) { CCBSelectorResolver ccbSelectorResolver = reader.SelectorResolver; if (ccbSelectorResolver != null) { selMenuHandler = ccbSelectorResolver.OnResolveCCBCCMenuItemSelector(target, selectorName); } } if (selMenuHandler == null) { CCLog.Log("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName); } else { var blockData = new BlockData(); blockData.mSELMenuHandler = selMenuHandler; blockData.mTarget = target; return(blockData); } } else { CCLog.Log("Unexpected empty selector."); } } else { CCLog.Log("Unexpected NULL target for selector."); } } return(null); }