private void Setup(string name, Direction direction, string styleID, ConnectionCount maxCount) { Name = name; Direction = direction; StyleID = styleID; MaxConnectionCount = maxCount; }
public void LogConnectionAttempt(string addressStr) { ConnectionCount.AddOrUpdate(addressStr, 0, (key, prev) => { return(prev + 1); }); try { if (ConnectionCount[addressStr] == BlockAtCount) { AddInternal(addressStr); int count; ConnectionCount.TryRemove(addressStr, out count); } } catch { // happens if the key was removed exactly at the time we were querying. Just ignore. } }
private void Setup(ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos) { MaxConnectionCount = maxCount; NodeSide = nodeSide; NodeSidePos = nodeSidePos; }
public ConnectionKnobAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0) : base(name, direction, styleID) { Setup(maxCount, nodeSide, nodeSidePos); }
public ConnectionKnobAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount) : base(name, direction, styleID) { Setup(maxCount, direction == Direction.Out? NodeSide.Right : NodeSide.Left, 0); }
public ConnectionPortAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount) { Setup(name, direction, styleID, maxCount); }
public ConnectionPortAttribute(string name, Direction direction, ConnectionCount maxCount) { Setup(name, direction, "Default", maxCount); }
public ValueConnectionKnobAttribute(string name, Direction direction, Type type, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0) : base(name, direction, maxCount, nodeSide, nodeSidePos) { Setup(type); }
public ValueConnectionKnobAttribute(string name, Direction direction, Type type, ConnectionCount maxCount) : base(name, direction, maxCount) { Setup(type); }
public ValueConnectionKnobAttribute(string name, Direction direction, string type, ConnectionCount maxCount) : base(name, direction, type, maxCount) { }
public FSMOutPutConnectionKnobAttribute(string name, Type type, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0) : base(name, Direction.Out, type, maxCount, nodeSide, nodeSidePos) { }
public FSMOutPutConnectionKnobAttribute(string name, Type type, ConnectionCount maxCount) : base(name, Direction.Out, type, maxCount) { }
/// <summary> /// The hash code of the connection count option is the hash code of the option type xored with the hash code of the connection count. /// </summary> public sealed override int GetHashCode() { return(base.GetHashCode() ^ ConnectionCount.GetHashCode()); }
internal sealed override int GetDataHashCode() { return(ConnectionCount.GetHashCode()); }
public FSMInputConnectionKnobAttribute(string name, string type, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0) : base(name, Direction.In, type, maxCount, nodeSide, nodeSidePos) { }
public FSMInputConnectionKnobAttribute(string name, string type, ConnectionCount maxCount) : base(name, Direction.In, type, maxCount) { }