コード例 #1
0
        internal static long CreateBattlefield(EcsRegistrar rgs, IEnumerable <long> battlefieldEntityIds)
        {
            var battlefieldId        = rgs.CreateEntity();
            var battlefieldContainer = new Parts.Container {
                Description = "battlefield", Tag = Vals.ContainerTag.Battlefield, ItemsAreVisible = true, Preposition = "on"
            };

            battlefieldEntityIds = battlefieldEntityIds ?? new long[] { };
            foreach (long entityId in battlefieldEntityIds)
            {
                battlefieldContainer.EntityIds.Add(entityId);
            }

            rgs.AddPart(battlefieldId, battlefieldContainer);

            return(battlefieldId);
        }
コード例 #2
0
        internal static long GetEntityFromBlueprint(EcsRegistrar rgs, string blueprintName)
        {
            var blueprintJson = File.ReadAllText(_blueprintFolder + blueprintName + _blueprintSuffix);

            return(rgs.CreateEntity(blueprintJson));
        }