public override int GetHash(ref int idx)
        {
            int hash = 1;

            foreach (var entity in GetPlayers())
            {
                hash += entity.curHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.skillBox.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }

            foreach (var entity in GetEnemies())
            {
                hash += entity.curHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }

            foreach (var entity in GetSpawners())
            {
                hash += entity.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }

            hash += _curGameState.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #2
0
        public override int GetHash(ref int idx)
        {
            int hash = 1;

            foreach (var entity in GetPlayers())
            {
                hash += entity.curHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.skillBox.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }

            //_debugService.Trace($"GetPlayers hash {hash}",true);
            foreach (var entity in GetEnemies())
            {
                hash += entity.curHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }
            //_debugService.Trace($"GetEnemies hash {hash}",true);

            foreach (var entity in GetSpawners())
            {
                hash += entity.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            }
            //_debugService.Trace($"GetSpawners hash {hash}",true);

            hash += _curGameState.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            //_debugService.Trace($"GetHash hash {hash}",true);
            return(hash);
        }
예제 #3
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += hasReachTarget.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += needMove.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #4
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += Deg.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += SkillId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #5
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += deg.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += pos.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += y.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #6
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += prefabId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += spawnPoint.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += spawnTime.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #7
0
            public int GetHash(ref int idx)
            {
                int hash = 1;

                hash += CurEnemyCount.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += MaxEnemyCount.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                hash += CurEnemyId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                return(hash);
            }
예제 #8
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += atkInterval.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += stopDistSqr.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += targetId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #9
0
        private int CalcHash(ref int idx)
        {
            int hashIdx  = 0;
            int hashCode = 0;

            foreach (var svc in _serviceContainer.GetAllServices())
            {
                if (svc is IHashCode hashSvc)
                {
                    hashCode += hashSvc.GetHash(ref hashIdx) * PrimerLUT.GetPrimer(hashIdx++);
예제 #10
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += Mass.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += Speed.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isEnable.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isOnFloor.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isSleep.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #11
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += inputUV.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isInputFire.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isSpeedUp.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += mousePos.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += skillId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #12
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += EntityId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += PrefabId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += Timer.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += Info.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #13
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += _animLen.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += _curAnimIdx.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += _curAnimName.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += _timer.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += configId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #14
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += deg.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += high.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += pos.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += radius.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += size.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += up.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += y.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
        public void Execute()
        {
            int hashCode = 0;
            int idx      = 0;

            hashCode += _hashableEntities.count.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);;
            foreach (var entity in _hashableEntities)
            {
                hashCode += entity.pos.value.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);;
                if (entity.hasDir)
                {
                    hashCode += ((int)entity.dir.value).GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                }
            }

            _gameStateContext.ReplaceHashCode(hashCode);
        }
예제 #16
0
        private int CalcHash(ref int idx, bool isNeedTrace)
        {
            int hashIdx  = 0;
            int hashCode = 0;
            var debug    = _serviceContainer.GetService <IDebugService>();

            foreach (var svc in _serviceContainer.GetAllServices())
            {
                if (svc is IHashCode hashSvc)
                {
                    hashCode += hashSvc.GetHash(ref hashIdx) * PrimerLUT.GetPrimer(hashIdx++);
                    //if (isNeedTrace) { debug.Trace($"svc {svc.GetType().Name} hashCode{hashCode}" ,true);}
                }
            }

            return(hashCode);
        }
예제 #17
0
        // Token: 0x060000CC RID: 204 RVA: 0x000055F0 File Offset: 0x000037F0
        private int CalcHash(ref int idx, bool isNeedTrace)
        {
            int           num     = 0;
            int           num2    = 0;
            IDebugService service = this._serviceContainer.GetService <IDebugService>();

            foreach (IService service2 in this._serviceContainer.GetAllServices())
            {
                IHashCode hashCode;
                bool      flag = (hashCode = (service2 as IHashCode)) != null;
                if (flag)
                {
                    num2 += hashCode.GetHash(ref num) * PrimerLUT.GetPrimer(num++);
                }
            }
            return(num2);
        }
예제 #18
0
        public int GetHash()
        {
            int hash = 1;
            int idx  = 0;

            foreach (var entity in allPlayers)
            {
                hash += entity.currentHealth.GetHash() * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash() * PrimerLUT.GetPrimer(idx++);
            }
            foreach (var entity in EnemyManager.Instance.allEnemy)
            {
                hash += entity.currentHealth.GetHash() * PrimerLUT.GetPrimer(idx++);
                hash += entity.transform.GetHash() * PrimerLUT.GetPrimer(idx++);
            }

            return(hash);
        }
예제 #19
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += _curSkillIdx.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += configId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isFiring.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            if (_skills != null)
            {
                foreach (var item in _skills)
                {
                    if (item != default(Lockstep.Game.Skill))
                    {
                        hash += item.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                    }
                }
            }
            return(hash);
        }
예제 #20
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += CdTimer.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += _curPartIdx.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += skillTimer.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += ((int)State) * PrimerLUT.GetPrimer(idx++);
            if (partCounter != null)
            {
                foreach (var item in partCounter)
                {
                    if (item != default(System.Int32))
                    {
                        hash += item.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
                    }
                }
            }
            return(hash);
        }
예제 #21
0
        public int GetHash(ref int idx)
        {
            int hash = 1;

            hash += EntityId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += PrefabId.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += curHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += damage.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isFire.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += isInvincible.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += maxHealth.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += moveSpd.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += turnSpd.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += animator.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += brain.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += colliderData.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += rigidbody.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += skillBox.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            hash += transform.GetHash(ref idx) * PrimerLUT.GetPrimer(idx++);
            return(hash);
        }
예제 #22
0
 public override int GetHash(ref int idx)
 {
     return((int)_i.randSeed * PrimerLUT.GetPrimer(idx++));
 }
예제 #23
0
 public int GetHash(ref int idx)
 {
     return(Id * PrimerLUT.GetPrimer(idx++));
 }
 public static int GetHash(this LFloat val)
 {
     return(PrimerLUT.GetPrimer(val._val));
 }
 public static int GetHash(this LVector2 val)
 {
     return(PrimerLUT.GetPrimer(val._x) + PrimerLUT.GetPrimer(val._y) * 17);
 }
 public static int GetHash(this LVector3 val)
 {
     return(PrimerLUT.GetPrimer(val._x)
            + PrimerLUT.GetPrimer(val._y) * 31
            + PrimerLUT.GetPrimer(val._z) * 37);
 }