コード例 #1
0
        private void CreateLoots(Player player, Artifact artifact)
        {
            var lootItems = _artifactLootGenerator.GenerateLoot(artifact);

            if (lootItems == null)
            {
                return;
            }

            LootContainer.Create().SetOwner(player).SetEnterBeamType(BeamType.artifact_found).AddLoot(lootItems.LootItems).BuildAndAddToZone(_zone, lootItems.Position);
        }
        public ArtifactLootItems GenerateLoot(Artifact artifact)
        {
            var lootItems = _lootGenerator.GenerateLoot(artifact);

            if (lootItems == null)
            {
                return(null);
            }

            var randomPosition = lootItems.Position.GetRandomPositionInRange2D(MIN_RANGE, MAX_RANGE);

            return(new ArtifactLootItems(randomPosition, lootItems.LootItems));
        }