示例#1
0
 private void Setup(string name, Direction direction, string styleID, ConnectionCount maxCount)
 {
     Name               = name;
     Direction          = direction;
     StyleID            = styleID;
     MaxConnectionCount = maxCount;
 }
示例#2
0
        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.
            }
        }
示例#3
0
 private void Setup(ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos)
 {
     MaxConnectionCount = maxCount;
     NodeSide           = nodeSide;
     NodeSidePos        = nodeSidePos;
 }
示例#4
0
 public ConnectionKnobAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0) : base(name, direction, styleID)
 {
     Setup(maxCount, nodeSide, nodeSidePos);
 }
示例#5
0
 public ConnectionKnobAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount) : base(name, direction, styleID)
 {
     Setup(maxCount, direction == Direction.Out? NodeSide.Right : NodeSide.Left, 0);
 }
示例#6
0
 public ConnectionPortAttribute(string name, Direction direction, string styleID, ConnectionCount maxCount)
 {
     Setup(name, direction, styleID, maxCount);
 }
示例#7
0
 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)
 {
 }
示例#11
0
 public FSMOutPutConnectionKnobAttribute(string name, Type type, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0)
     : base(name, Direction.Out, type, maxCount, nodeSide, nodeSidePos)
 {
 }
示例#12
0
 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());
 }
示例#15
0
 public FSMInputConnectionKnobAttribute(string name, string type, ConnectionCount maxCount, NodeSide nodeSide, float nodeSidePos = 0)
     : base(name, Direction.In, type, maxCount, nodeSide, nodeSidePos)
 {
 }
示例#16
0
 public FSMInputConnectionKnobAttribute(string name, string type, ConnectionCount maxCount)
     : base(name, Direction.In, type, maxCount)
 {
 }