示例#1
0
        public override bool Equals(NetworkSyncItem obj)
        {
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            NetworkSyncVarValue other = (NetworkSyncVarValue)obj;

            List <NetworkSyncItem> otherList = other.Value;

            if (Value.Count != otherList.Count)
            {
                return(false);
            }

            bool allEqual = true;

            for (int i = 0; i < Value.Count; i++)
            {
                allEqual = allEqual && (Value[i].Equals(otherList[i]));
            }

            return(allEqual);
        }
示例#2
0
        public override bool Equals(NetworkSyncItem obj)
        {
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            return(this.Value == ((NetworkSyncFloat)obj).Value);
        }
示例#3
0
文件: SyncVar.cs 项目: travakin/PRNet
        public void Assign(NetworkSyncItem val)
        {
            if (currentItem != null)
            {
                prevItem = currentItem;
            }
            else
            {
                prevItem = val;
            }

            currentItem = val;
        }
示例#4
0
        public override bool Equals(NetworkSyncItem obj)
        {
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            List <string> otherList = ((NetworkSyncStringList)obj).Value;

            if (Value.Count != otherList.Count)
            {
                return(false);
            }

            bool allEqual = true;

            for (int i = 0; i < Value.Count; i++)
            {
                allEqual = allEqual && (Value[i].Equals(otherList[i]));
            }

            return(allEqual);
        }
示例#5
0
 public override bool Equals(NetworkSyncItem obj)
 {
     return(obj.GetType() == typeof(NetworkSyncPass));
 }
示例#6
0
 public abstract bool Equals(NetworkSyncItem obj);
示例#7
0
文件: SyncVar.cs 项目: travakin/PRNet
 public void Equalize()
 {
     prevItem = currentItem;
 }
示例#8
0
文件: SyncVar.cs 项目: travakin/PRNet
        public SyncVar(string name, NetworkSyncItem item)
        {
            VariableName = name;

            this.Assign(item);
        }