Пример #1
0
        // Update is called once per frame
        void Update()
        {
            // make every entity broadcasts an event to the other entities every frame
            PerceptionEVManager.TriggerEvent("PERCEPTION", new Hashtable()
            {
                { "OBJECT", this.gameObject }
            });

            // every update, if the entity is not being controlled, check for perception component alerted or not
            if (!Controlled && Perception != null && GambitCollection != null)
            {
                // enable the gambit if gambit is off and is alerted
                if (Perception.Alerted && !GambitCollection.enabled)
                {
                    GambitCollection.enabled = true;
                }
            }

            // test levelling
            if (Input.GetKeyUp(KeyCode.Space))
            {
                if (EntityLevel != null)
                {
                    EntityLevel.ModifyExp(50);
                }
            }
        }
Пример #2
0
 public ReadOnlyCollection <Entity> FindAllByHierarchyStartLevel(EntityLevel hierarchyStartLevel)
 {
     return(this.ItemList.FindAll(
                delegate(Entity entity)
     {
         return entity.HierarchyStartLevel == hierarchyStartLevel;
     }).AsReadOnly());
 }
Пример #3
0
 public static void CopyEntityNode(Guid organizationId, Guid?instanceId, Guid sourceId, Guid targetId, EntityLevel level)
 {
     ClientDataSet.EntityNodeRow source = GetEntityNode(sourceId, organizationId);
     if (source != null)
     {
         InsertEntityNode(organizationId, instanceId, source.Name, source.EntityNodeTypeId, source.EntityId, targetId, level);
     }
 }
Пример #4
0
        public static Guid InsertEntityNode(Guid organizationId, Guid?instanceId, string name, Guid entityNodeTypeId, Guid entityId, Guid parentEntityNodeId, EntityLevel level)
        {
            ClientDataSet.EntityNodeDataTable table = new ClientDataSet.EntityNodeDataTable();
            ClientDataSet.EntityNodeRow       row   = table.NewEntityNodeRow();

            row.EntityNodeId = Guid.NewGuid();
            row.Name         = name;
            if (level == EntityLevel.Instance)
            {
                if (instanceId.HasValue)
                {
                    row.InstanceId = instanceId.Value;
                }
            }
            row.OrganizationId   = organizationId;
            row.EntityNodeTypeId = entityNodeTypeId;
            row.EntityId         = entityId;
            row.FullPath         = string.Empty;
            if (parentEntityNodeId != Guid.Empty)
            {
                row.ParentEntityNodeId = parentEntityNodeId;
            }
            row.OrderNumber = 0;
            table.AddEntityNodeRow(row);

            using (EntityNodeTableAdapter adapter = new EntityNodeTableAdapter(OrganizationProvider.GetConnectionString(organizationId)))
            {
                adapter.Update(row);
            }

            return(row.EntityNodeId);
        }
Пример #5
0
 public Entity()
 {
     m_HierarchyStartLevel = EntityLevel.Organization;
 }