Exemple #1
0
        public override int GetHashCode()
        {
            int hash = 17;

            hash = hash * 31 + XYZ.GetHashCode();
            hash = hash * 31 + ReplicaLevel.GetHashCode();
            return(hash);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (name != null ? name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ position.GetHashCode();
         hashCode = (hashCode * 397) ^ faceCell.GetHashCode();
         hashCode = (hashCode * 397) ^ direction.GetHashCode();
         return(hashCode);
     }
 }
Exemple #3
0
        public List <Entity> LoadUnspawnedEntities(Int3 batchId)
        {
            lock (parsedBatches)
            {
                if (parsedBatches.Contains(batchId))
                {
                    return(new List <Entity>());
                }

                parsedBatches.Add(batchId);
            }

            Random random = new Random(batchId.GetHashCode());

            List <Entity>           entities    = new List <Entity>();
            List <EntitySpawnPoint> spawnPoints = batchCellsParser.ParseBatchData(batchId);

            foreach (EntitySpawnPoint esp in spawnPoints)
            {
                if (esp.Density > 0)
                {
                    DstData dstData;
                    if (lootDistributionData.GetBiomeLoot(esp.BiomeType, out dstData))
                    {
                        entities.AddRange(SpawnEntitiesUsingRandomDistribution(esp, dstData, random));
                    }
                    else if (esp.ClassId != null)
                    {
                        entities.AddRange(SpawnEntitiesStaticly(esp));
                    }
                }
            }

            if (entities.Count == 0)
            {
                lock (emptyBatches)
                {
                    emptyBatches.Add(batchId);
                }
            }
            else
            {
                Log.Info("Spawning " + entities.Count + " entities from " + spawnPoints.Count + " spawn points in batch " + batchId);
            }

            return(entities);
        }
Exemple #4
0
 public override int GetHashCode() => (FromShard.GetHashCode() * 31 + ToShard.GetHashCode());
 public DeterministicBatchGenerator(Int3 batchId)
 {
     random = new Random(batchId.GetHashCode());
 }
Exemple #6
0
 public override int GetHashCode()
 {
     return(ShardID.GetHashCode() * 31 + Generation.GetHashCode());
 }
        public override int GetHashCode()
        {
            int num = 1;

            if (EventType != 0)
            {
                num ^= EventType.GetHashCode();
            }
            if (EventId != 0)
            {
                num ^= EventId.GetHashCode();
            }
            if (parentEventId_.HasValue)
            {
                num ^= ParentEventId.GetHashCode();
            }
            if (Int1 != 0)
            {
                num ^= Int1.GetHashCode();
            }
            if (Int2 != 0)
            {
                num ^= Int2.GetHashCode();
            }
            if (Int3 != 0)
            {
                num ^= Int3.GetHashCode();
            }
            if (Int4 != 0)
            {
                num ^= Int4.GetHashCode();
            }
            if (Int5 != 0)
            {
                num ^= Int5.GetHashCode();
            }
            if (Int6 != 0)
            {
                num ^= Int6.GetHashCode();
            }
            if (Int7 != 0)
            {
                num ^= Int7.GetHashCode();
            }
            if (String1.Length != 0)
            {
                num ^= String1.GetHashCode();
            }
            if (Bool1)
            {
                num ^= Bool1.GetHashCode();
            }
            if (cellCoord1_ != null)
            {
                num ^= CellCoord1.GetHashCode();
            }
            if (cellCoord2_ != null)
            {
                num ^= CellCoord2.GetHashCode();
            }
            if (CompanionReserveState1 != 0)
            {
                num ^= CompanionReserveState1.GetHashCode();
            }
            if (CompanionReserveState2 != 0)
            {
                num ^= CompanionReserveState2.GetHashCode();
            }
            if (DamageReductionType1 != 0)
            {
                num ^= DamageReductionType1.GetHashCode();
            }
            if (FightResult1 != 0)
            {
                num ^= FightResult1.GetHashCode();
            }
            if (gameStatistics1_ != null)
            {
                num ^= GameStatistics1.GetHashCode();
            }
            if (TeamsScoreModificationReason1 != 0)
            {
                num ^= TeamsScoreModificationReason1.GetHashCode();
            }
            if (optInt1_.HasValue)
            {
                num ^= OptInt1.GetHashCode();
            }
            if (optInt2_.HasValue)
            {
                num ^= OptInt2.GetHashCode();
            }
            if (optInt3_.HasValue)
            {
                num ^= OptInt3.GetHashCode();
            }
            if (optInt4_.HasValue)
            {
                num ^= OptInt4.GetHashCode();
            }
            num ^= ((object)cellCoordList1_).GetHashCode();
            num ^= ((object)spellMovementList1_).GetHashCode();
            num ^= ((object)castTargetList1_).GetHashCode();
            num ^= ((object)intList1_).GetHashCode();
            num ^= ((object)intList2_).GetHashCode();
            if (_unknownFields != null)
            {
                num ^= ((object)_unknownFields).GetHashCode();
            }
            return(num);
        }
Exemple #8
0
 public override int GetHashCode()
 {
     return(size.GetHashCode() * 17 + (grid != null ? grid.GetHashCode() : 0));
 }