public ICommandResult Handle(GetObjectStatusCommand command)
        {
            ICommandResult result = new GetObjectStatusCommandResult();

            _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Debug, new { command.ObjectStatus, command.RequestHost }, "ObjectStatusCommandHandler.Handle(Get)");

            try
            {
                if (_objectStatusRepository.CheckExists(command.ObjectStatus))
                {
                    ObjectStatus objectStatus = _objectStatusRepository.Get(command.ObjectStatus);

                    if (objectStatus != null)
                    {
                        result = new GetObjectStatusCommandResult(200, objectStatus.Name);
                    }
                }

                else if (_objectStatusRepository.Valid)
                {
                    result = new GetObjectStatusCommandResult(400, new Notification("Object Status", "Could not be found"));
                }
            }
            catch (Exception e)
            {
                _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Error, new { command.ObjectStatus, command.RequestHost }, e);
            }

            return(result);
        }
Пример #2
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Debug.Log("clicked!");
            count++;
            //ws.Send("clicked No. " + count.ToString());

            ObjectStatus a = new ObjectStatus(1, "hello");
            ws.Send(JsonUtility.ToJson(a));
        }
        // Debug.Log(matched);
        if (matched && !roomBroken)
        {
            Text score_text = score_object.GetComponent <Text>();
            score_text.text = "対戦相手が見つかりました!";

            battlewait += Time.deltaTime;
            //Debug.Log(battlewait);
            if (battlewait >= 2)
            {
                Debug.Log("go next scene");

                SceneManager.sceneLoaded += GameSceneLoaded;
                SceneManager.LoadScene(battleSceneName);
            }
        }

        if (roomBroken)
        {
            GameObject panel = Instantiate(broken_panel, transform.position, Quaternion.identity, this.transform);
            ws.Close();
            roomBroken = false;
        }
    }
Пример #3
0
 /// <summary>
 /// 發生於物件狀態變更
 /// </summary>
 protected virtual void OnStatusChanged(ObjectStatus oldValue, ObjectStatus newValue)
 {
     if (StatusChanged != null)
     {
         StatusChanged(this, oldValue, newValue);
     }
 }
Пример #4
0
        public static List <TEntityChild> SetChildObjStatuses <T, TEntityChild>(T childObjectRepository,
                                                                                long parentObjId,
                                                                                ObjectStatus newStatus)
            where T : BaseObjRepository <TEntityChild>
            where TEntityChild : BuildObject
        {
            if (typeof(TEntityChild) == typeof(ScreenShot) && newStatus == ObjectStatus.Passed)
            {
                var screenShotRepo   = ScreenShotRepository.Instance;
                var childScreenShots = screenShotRepo.Find(new { ParentObjId = parentObjId });

                foreach (var screenShot in childScreenShots)
                {
                    SetParentObjStatus <ScreenShotRepository, ScreenShot>(screenShotRepo, screenShot.Id, newStatus);
                }

                return(childObjectRepository.Find(new { ParentObjId = parentObjId }).ToList());
            }

            var childItems = childObjectRepository.Find(new { ParentObjId = parentObjId }).ToList();

            childItems.ForEach(item => item.Status = newStatus);
            childObjectRepository.Update(childItems);

            return(childItems);
        }
        public override DataObject GetDataObjectBySyncEntity(
            Guid appObjPK,
            Type appObjType,
            ObjectStatus changedObjStatus,
            Guid auditChangePK)
        {
            var appObject = Helper.CreateDataObject(appObjType, appObjPK);

            if (changedObjStatus != ObjectStatus.Deleted)
            {
                //  Получаем дату операции изменения аудита связанную с SyncEntity.
                var auditDate = AuditTools.GetAuditEntityOperationTimeByPK(auditChangePK);
                //  Откатываем вычитанный изменённый объект, к состоянию на дату изменения.
                if (auditDate != null)
                {
                    AuditTools.GetObjForDate(auditDate.Value, ref appObject, Context.OnlySelfRollbackFromAudit, true);
                }
                else
                {
                    throw new Exception($"Ошибка - не удалось определить дату операции изменения аудита(AuditEntity:{auditChangePK})");
                }
            }

            //Если объект удалён, то создаём его экземпляр для передачи в сообщении ключа этого объекта.
            return(appObject);
        }
Пример #6
0
 protected virtual void dirty()
 {
     if (_objectStatus == ObjectStatus.Clean)
     {
         _objectStatus = ObjectStatus.Dirty;
     }
 }
Пример #7
0
 public RFQHeaderItem(IEnumerable <GenericViewModel> itemsList)
 {
     InitiateCommands();
     ObjStatus = new ObjectStatus {
         IsNew = true
     };
 }
        public void EnsureLoaded()
        {
            if (MuteNotify)
            {
                return;
            }

            IContext       ctx        = interceptable.GetInterceptor().Context;
            IObjectManager om         = ctx.ObjectManager;
            PropertyStatus propStatus = om.GetPropertyStatus(interceptable, propertyName);

            if (propStatus == PropertyStatus.NotLoaded)
            {
                ObjectStatus objStatus = om.GetObjectStatus(interceptable);
                if (!(objStatus == ObjectStatus.UpForCreation))
                {
                    bool stackMute = MuteNotify;
                    MuteNotify = true;

                    ctx.PersistenceEngine.LoadProperty(interceptable, propertyName);

                    MuteNotify = stackMute;
                }
            }
        }
Пример #9
0
 protected virtual void dirty()
 {
     if (_objectStatus == ObjectStatus.Clean)
     {
         _objectStatus = ObjectStatus.Dirty;
     }
 }
Пример #10
0
        public static void Main(string[] args)
        {
            Noun zPlayer = new Player();

            MyNouns.Add(zPlayer);
            var          zObj = new Thing();
            ScreenCell2D loc  = new ScreenCell2D(10, 5);

            zObj.GoTo(loc);
            MyNouns.Add(zObj);
            MyNouns.Add(new Alien());
            DoInit(MyNouns);
            ObjectStatus status = new ObjectStatus();

            while (status.state != ObjectStatus.ActiveState.Dead)
            {
                foreach (IMovable item in MyNouns)
                {
                    item.OnMove();
                    item.OnDraw();
                }
                zPlayer.GetStatus(ref status);
            }
            DoDeInit(MyNouns);
        }
Пример #11
0
 public static byte[] NewTick(List <ObjectStatus> statuses, Dictionary <StatType, object> playerStats)
 {
     using (PacketWriter wtr = new PacketWriter(new MemoryStream()))
     {
         wtr.Write((byte)PacketId.NewTick);
         wtr.Write((short)statuses.Count);
         foreach (ObjectStatus k in statuses)
         {
             k.Write(wtr);
         }
         if (playerStats.Count > 0)
         {
             wtr.Write((byte)playerStats.Count);
             foreach (KeyValuePair <StatType, object> k in playerStats)
             {
                 wtr.Write((byte)k.Key);
                 if (ObjectStatus.IsStringStat(k.Key))
                 {
                     wtr.Write((string)k.Value);
                 }
                 else
                 {
                     wtr.Write((int)k.Value);
                 }
             }
         }
         return((wtr.BaseStream as MemoryStream).ToArray());
     }
 }
Пример #12
0
        public virtual void RegisterDeleted(object obj)
        {
            this.Context.LogManager.Info(this, "Registering object as up for deletion", "Type: " + obj.GetType().ToString());             // do not localize

            object result       = m_objectStatusLookup[obj];
            bool   addToDeleted = true;

            if (result != null)
            {
                ObjectStatus objStatus = (ObjectStatus)result;
                if (objStatus == ObjectStatus.UpForCreation)
                {
                    //If the object has been created during the same Unit of Work, we don't have to
                    //wait for a commit operation to let the object enter a state of Deleted (that is,
                    //the object does not have to enter the state of UpForDeletion until commit makes it Deleted)
                    m_listCreated.Remove(obj);
                    m_objectStatusLookup.Remove(obj);
                    this.Context.ObjectManager.ClearUpdatedStatuses(obj);
                    this.Context.ObjectManager.SetObjectStatus(obj, ObjectStatus.Deleted);
                    addToDeleted = false;
                }
            }
            this.Context.ObjectCloner.EnsureIsClonedIfEditing(obj);
            if (addToDeleted)
            {
                m_listDirty.Remove(obj);
                m_listDeleted.Add(obj);
                m_objectStatusLookup[obj] = ObjectStatus.UpForDeletion;
                this.Context.ObjectManager.SetObjectStatus(obj, ObjectStatus.UpForDeletion);
            }
            this.Context.IdentityMap.RemoveObject(obj);
        }
Пример #13
0
        public virtual void RegisterDirty(object obj)
        {
            this.Context.LogManager.Info(this, "Registering object as dirty", "Type: " + obj.GetType().ToString());             // do not localize
            object result = m_objectStatusLookup[obj];

            if (result != null)
            {
                ObjectStatus objStatus = (ObjectStatus)result;
                if (objStatus == ObjectStatus.UpForDeletion)
                {
                    throw new UnitOfWorkException("Can't register object as 'Dirty' when it is already registered as 'Deleted'!");                     // do not localize
                }
                if (objStatus == ObjectStatus.UpForCreation)
                {
                    return;
                }
            }
            this.Context.ObjectCloner.EnsureIsClonedIfEditing(obj);

            //Following bug fix (adding the if) submitted by Vlad Ivanov
            if (m_listDirty.IndexOf(obj) == -1)
            {
                m_listDirty.Add(obj);
            }

            m_objectStatusLookup[obj] = ObjectStatus.Dirty;
            this.Context.ObjectManager.SetObjectStatus(obj, ObjectStatus.Dirty);
        }
Пример #14
0
        public virtual void RegisterCreated(object obj)
        {
            this.Context.LogManager.Info(this, "Registering object as up for creation", "Type: " + obj.GetType().ToString());             // do not localize
            object result = m_objectStatusLookup[obj];

            if (result != null)
            {
                ObjectStatus objStatus = (ObjectStatus)result;
                if (objStatus == ObjectStatus.Dirty)
                {
                    throw new UnitOfWorkException("Can't register object as 'Created' when it is already registered as 'Dirty'!");                     // do not localize
                }
                if (objStatus == ObjectStatus.UpForDeletion)
                {
                    throw new UnitOfWorkException("Can't register object as 'Created' when it is already registered as 'Deleted'!");                     // do not localize
                }
                if (objStatus == ObjectStatus.UpForCreation)
                {
                    throw new UnitOfWorkException("Object is already registered as 'Created'!");                     // do not localize
                }
            }
            this.Context.ObjectCloner.EnsureIsClonedIfEditing(obj);
            m_listCreated.Add(obj);
            m_objectStatusLookup[obj] = ObjectStatus.UpForCreation;
            this.Context.ObjectManager.SetObjectStatus(obj, ObjectStatus.UpForCreation);
            this.Context.IdentityMap.RegisterCreatedObject(obj);
        }
Пример #15
0
    void Update()
    {
        if (Input.GetKey(KeyCode.Y))
        {
            if (mapStatus == ObjectStatus.Hidden)
            {
                mapStatus        = ObjectStatus.Showing;
                currentCoroutine = StartCoroutine(MoveObject(map, mapTargetObject, () => mapStatus = ObjectStatus.Shown));
            }
            else if (mapStatus == ObjectStatus.Hiding)
            {
                StopCoroutine(currentCoroutine);
                mapStatus        = ObjectStatus.Showing;
                currentCoroutine = StartCoroutine(MoveObject(map, mapTargetObject, () => mapStatus = ObjectStatus.Shown));
            }
        }
        else
        {
            if (mapStatus == ObjectStatus.Shown)
            {
                mapStatus        = ObjectStatus.Hiding;
                currentCoroutine = StartCoroutine(MoveObject(map, mapInitialObject, () => mapStatus = ObjectStatus.Hidden));
            }
            else if (mapStatus == ObjectStatus.Showing)
            {
                StopCoroutine(currentCoroutine);
                mapStatus        = ObjectStatus.Hiding;
                currentCoroutine = StartCoroutine(MoveObject(map, mapInitialObject, () => mapStatus = ObjectStatus.Hidden));
            }
        }

        if (Input.GetKey(KeyCode.U))
        {
            if (compassStatus == ObjectStatus.Hidden)
            {
                compassStatus    = ObjectStatus.Showing;
                currentCoroutine = StartCoroutine(MoveObject(compass, compassTargetObject, () => compassStatus = ObjectStatus.Shown));
            }
            else if (compassStatus == ObjectStatus.Hiding)
            {
                StopCoroutine(currentCoroutine);
                compassStatus    = ObjectStatus.Showing;
                currentCoroutine = StartCoroutine(MoveObject(compass, compassTargetObject, () => compassStatus = ObjectStatus.Shown));
            }
        }
        else
        {
            if (compassStatus == ObjectStatus.Shown)
            {
                compassStatus    = ObjectStatus.Hiding;
                currentCoroutine = StartCoroutine(MoveObject(compass, compassInitialObject, () => compassStatus = ObjectStatus.Hidden));
            }
            else if (compassStatus == ObjectStatus.Showing)
            {
                StopCoroutine(currentCoroutine);
                compassStatus    = ObjectStatus.Hiding;
                currentCoroutine = StartCoroutine(MoveObject(compass, compassInitialObject, () => compassStatus = ObjectStatus.Hidden));
            }
        }
    }
Пример #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="info"></param>
 public DataObject(ObjectInfo info)
 {
     _Info   = info;
     _Index  = info.Index;
     _Value  = info.DefaultValue;
     _Status = ObjectStatus.NoError;
 }
Пример #17
0
        private void EnableVisibility(ObjectStatus status, FriendType friend)
        {
            visiblilityEnabled   = true;
            TRVisibility.Visible = true;

            RbtPublic.Text      = language.GetString("LableVisibilityVisibility0");
            RbtPublic.Checked   = status == ObjectStatus.Public;
            RbtPrivat.Text      = language.GetString("LableVisibilityVisibility1");
            RbtPrivat.Checked   = status == ObjectStatus.Private;
            RbtUnlisted.Text    = language.GetString("LableVisibilityVisibility2");
            RbtUnlisted.Checked = status == ObjectStatus.Unlisted;

            CbxFriends.Items.Clear();
            foreach (int i in Enum.GetValues(typeof(FriendType)))
            {
                string key  = string.Format("TextFriendType{0}", i);
                string text = language.GetString(key);
                if (!string.IsNullOrEmpty(text))
                {
                    ListItem   listItem = new ListItem(text, i.ToString());
                    FriendType check    = (FriendType)i;
                    if ((friend & check) == check)
                    {
                        listItem.Selected = true;
                    }
                    CbxFriends.Items.Add(listItem);
                }
            }
        }
Пример #18
0
 public AssemblyFile(ISchemaBase parent, AssemblyFile assemblyFile, ObjectStatus status)
     : base(parent, ObjectType.AssemblyFile)
 {
     this.Name    = assemblyFile.Name;
     this.Content = assemblyFile.Content;
     this.Status  = status;
 }
Пример #19
0
 public virtual void Die()
 {
     if (_status == ObjectStatus.Active)
     {
         _status = _dieTime != TimeSpan.Zero ? ObjectStatus.Dying : ObjectStatus.Dead;
     }
 }
Пример #20
0
 public AssemblyFile(ISchema parent, AssemblyFile assemblyFile, ObjectStatus status)
     : base(parent, MsSql.ObjectType1.AssemblyFile)
 {
     Name = assemblyFile.Name;
     content = assemblyFile.content;
     Status = status;
 }
Пример #21
0
        public int GetSpriteIndex(SpritePositionEnum spritePosition, ObjectStatus status)
        {
            if (dicSpritesIndex.ContainsKey(status))
            {
                SpritePosition pos = dicSpritesIndex[status];
                switch (spritePosition)
                {
                case SpritePositionEnum.UPPER:
                    return(pos.UPPER);

                case SpritePositionEnum.DOWN:
                    return(pos.DOWN);

                case SpritePositionEnum.LEFT:
                    return(pos.LEFT);

                case SpritePositionEnum.RIGHT:
                    return(pos.RIGHT);

                case SpritePositionEnum.DOWN_LEFT:
                    return(pos.DOWN_LEFT);

                case SpritePositionEnum.DOWN_RIGHT:
                    return(pos.DOWN_RIGHT);

                case SpritePositionEnum.UPPER_LEFT:
                    return(pos.UPPER_LEFT);

                case SpritePositionEnum.UPPER_RIGHT:
                    return(pos.UPPER_RIGHT);
                }
            }
            return(-1);
        }
Пример #22
0
 /// <summary>
 /// Initialize method, used for initializing object's variables and fields
 /// </summary>
 public virtual void Initialize()
 {
     if (!(status == ObjectStatus.Active))
     {
         status = ObjectStatus.Active;
     }
 }
Пример #23
0
        public void RestoreFromClone(object obj)
        {
            IObjectManager om    = this.Context.ObjectManager;
            IObjectClone   clone = ((ICloneHelper)obj).GetObjectClone();

            if (clone == null)
            {
                throw new EditException("Object has no cached clone!");
            }

            IClassMap classMap = this.Context.DomainMap.MustGetClassMap(obj.GetType());

            foreach (IPropertyMap propertyMap in classMap.GetAllPropertyMaps())
            {
                if (propertyMap.IsCollection)
                {
                    //TODO: Implement this
                }
                else
                {
                    if (clone.HasOriginalValues(propertyMap.Name))
                    {
                        om.SetOriginalPropertyValue(obj, propertyMap.Name, clone.GetOriginalPropertyValue(propertyMap.Name));
                    }

                    om.SetPropertyValue(obj, propertyMap.Name, clone.GetPropertyValue(propertyMap.Name));
                    om.SetNullValueStatus(obj, propertyMap.Name, clone.GetNullValueStatus(propertyMap.Name));
                    om.SetUpdatedStatus(obj, propertyMap.Name, clone.GetUpdatedStatus(propertyMap.Name));
                }
            }

            IIdentityHelper identityHelper = obj as IIdentityHelper;

            if (identityHelper != null)
            {
                identityHelper.SetIdentity(clone.GetIdentity());

                if (clone.HasIdentityKeyParts())
                {
                    identityHelper.GetIdentityKeyParts().Clear();
                    foreach (object keyPart in clone.GetIdentityKeyParts())
                    {
                        identityHelper.GetIdentityKeyParts().Add(keyPart);
                    }
                }
                if (clone.HasKeyStruct())
                {
                    identityHelper.SetKeyStruct(clone.GetKeyStruct());
                }
            }

            ObjectStatus objStatus = clone.GetObjectStatus();

            om.SetObjectStatus(obj, objStatus);

            if (objStatus == ObjectStatus.NotRegistered)
            {
                this.Context.IdentityMap.UnRegisterCreatedObject(obj);
            }
        }
Пример #24
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="info"></param>
 public DataObject(ObjectInfo info)
 {
     _Info = info;
     _Index = info.Index;
     _Value = info.DefaultValue;
     _Status = ObjectStatus.NoError;
 }
Пример #25
0
        public bool Create(ObjectStatus objectStatus)
        {
            bool Created = true;

            try
            {
                _context.Connection.Execute(
                    "SP_NewObjectStatus",
                    new
                {
                    objectStatus.Id,
                    objectStatus.Name
                },
                    commandType: CommandType.StoredProcedure);
            }
            catch (Exception e)
            {
                Created = false;
                AddNotification("Error", e.Message);

                _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Error, new { ObjectStatus = objectStatus }, e);
            }

            return(Created);
        }
Пример #26
0
 public override void UpdateFrame(float dt)
 {
     if (status == ObjectStatus.God)
     {
         GodTimer -= dt;
         if (GodTimer <= 0.0f)
         {
             status = ObjectStatus.Live;
         }
     }
     if (status == ObjectStatus.Live)
     {
         if (CType != ContactType.None)
         {
             Contacter.Instance.Add(this);
         }
     }
     if (status == ObjectStatus.Die)
     {
         DieTime -= dt;
         if (DieTime <= 0.0f)
         {
             Die();
             Remove();
         }
     }
     if (status != ObjectStatus.Die && HP <= 0)
     {
         status = ObjectStatus.Die;
     }
 }
        /// <summary>
        /// Gets the time when auditable operation occurred with the specified object.
        /// </summary>
        /// <remarks>
        /// In the audit update queue of the data service not only objects do from OData (where fields of <see cref="IDataObjectWithAuditFields"/>
        /// should be already set), can appear. For example, objects from a business server or detail aggregator.
        /// Therefore, audit operation time cannot always be recognized and server time will be used for this situation.
        /// </remarks>
        /// <param name="operatedObject">The operated object.</param>
        /// <returns>
        /// Returns time when auditable operation occurred using <see cref="IDataObjectWithAuditFields.CreateTime"/> for new object
        /// or <see cref="IDataObjectWithAuditFields.EditTime"/> for changed object.
        /// </returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="operatedObject"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when data object doesn't implement <see cref="IDataObjectWithAuditFields"/> in order to use with offline audit.</exception>
        protected override DateTime GetAuditOperationTime(DataObject operatedObject)
        {
            Contract.Requires <ArgumentNullException>(operatedObject != null);

            var auditableDataObject = operatedObject as IDataObjectWithAuditFields;

            if (auditableDataObject == null)
            {
                throw new ArgumentException("Data object must implement IDataObjectWithAuditFields in order to use with offline audit.");
            }

            ObjectStatus objectStatus = operatedObject.GetStatus(false);

            switch (objectStatus)
            {
            case ObjectStatus.Created:
                if (auditableDataObject.CreateTime == null)
                {
                    if (LogService.Log.IsWarnEnabled)
                    {
                        LogService.LogWarn($"Data object {operatedObject.GetType().FullName}({operatedObject.__PrimaryKey}) is created but doesn't contain create time.");
                    }

                    break;
                }

                return(auditableDataObject.CreateTime.Value);

            case ObjectStatus.Altered:
                if (auditableDataObject.EditTime == null)
                {
                    if (LogService.Log.IsWarnEnabled)
                    {
                        LogService.LogWarn($"Data object {operatedObject.GetType().FullName}({operatedObject.__PrimaryKey}) is changed but doesn't contain edit time.");
                    }

                    break;
                }

                return(auditableDataObject.EditTime.Value);

            case ObjectStatus.Deleted:
                // TODO: deleting query through OData doesn't contain body, therefore we cannot set right audit operation time
                break;

            case ObjectStatus.UnAltered:
                break;

            default:
                throw new ArgumentOutOfRangeException($"Unknown DataObject status: {objectStatus}");
            }

            if (PersistUtcDates)
            {
                return(DateTimeOffset.UtcNow.DateTime);
            }

            return(base.GetAuditOperationTime(operatedObject));
        }
Пример #28
0
 public void CheckObjectStatusChanged()
 {
     if (this.ObjectStatus != this.previousObjectStatus)
     {
         this.previousObjectStatus = this.ObjectStatus;
         this.OnPropertyChanged(nameof(this.ObjectStatus));
     }
 }
Пример #29
0
        internal virtual bool CreateRecord()
        {
            this.mId         = 0;
            this.mObjectGuid = Guid.NewGuid();

            this.mStatus = ObjectStatus.NewOne;
            return(true);
        }
Пример #30
0
    // Start is called before the first frame update
    void Start()
    {
        parentStatus = parent.GetComponent <ObjectStatus>();

        parentSprite = parent.GetComponent <SpriteRenderer>();

        MoveToParentPosition();
    }
Пример #31
0
 protected SchemaBase(string nameCharacterOpen, string nameCharacterClose, ObjectType objectType)
 {
     this.Guid               = System.Guid.NewGuid().ToString();
     this.ObjectType         = objectType;
     this.status             = ObjectStatus.Original;
     this.nameCharacterClose = nameCharacterClose;
     this.nameCharacterOpen  = nameCharacterOpen;
 }
Пример #32
0
    private void Start()
    {
        camera = Camera.main;

        status = thisObject.GetComponent <ObjectStatus>();

        hPBarImage = GetComponent <Image>();
    }
        public override List <string> GetChangedFieldBySyncEntity(ObjectStatus changedObjStatus, Guid auditChangePK)
        {
            var result = changedObjStatus != ObjectStatus.Deleted
                         ? AuditTools.GetChangeFieldFromAuditEntityByPK(auditChangePK)
                         : null;

            return(result);
        }
Пример #34
0
 public SqlAction(SchemaBase item)
 {
     if ((item.ObjectType1 == ObjectType1.Column) || (item.ObjectType1 == ObjectType1.Index) || (item.ObjectType1 == ObjectType1.Constraint))
         Name = item.Name;
     else
         Name = item.FullName;
     action = item.Status;
     Type1 = item.ObjectType1;
     childs = new List<SqlAction>();
 }
Пример #35
0
 /// <summary>
 /// 创建一个活体
 /// </summary>
 public LiveObject(Node node,float CreatTime,float DieTime)
     : base(node)
 {
     Sce.Pss.HighLevel.GameEngine2D.Scheduler.Instance.Schedule(this, Tick, 0.0f, false);
     this.GodTimer = CreatTime;
     this.DieTime = DieTime;
     this.Born();
     //this.ContactDate = new List<Contacter.Contact>();//碰撞资料
     this.status = ObjectStatus.God;
 }
Пример #36
0
 /// <summary>
 /// Initialize method, used for initializing object's variables and fields
 /// </summary>
 public virtual void Initialize()
 {
     if (!(status == ObjectStatus.Active))
         status = ObjectStatus.Active;
 }
Пример #37
0
 protected SchemaBase(ObjectType1 objectType1)
 {
     Guid = System.Guid.NewGuid().ToString();
     ObjectType1 = objectType1;
     status = ObjectStatus.OriginalStatus;
 }
Пример #38
0
 /// <summary>
 /// Method called when you want the object to die
 /// </summary>
 public void Die()
 {
     if (status == ObjectStatus.Active)
     {
         if (dieTime != TimeSpan.Zero)
             status = ObjectStatus.Dying;
         else
             status = ObjectStatus.Dead;
     }
 }
Пример #39
0
 /// <summary>
 /// Logic to perform when the object is dying, but not dead yet
 /// </summary>
 /// <param name="gameTime">The GameTime object from the active screen</param>
 public virtual void Dying(GameTime gameTime)
 {
     if (diePercent >= 1)
         status = ObjectStatus.Dead;
     else
     {
         float dieDelta = (float)(gameTime.ElapsedGameTime.TotalMilliseconds / dieTime.TotalMilliseconds);
         diePercent += dieDelta;
     }
 }
		public void SetObjectStatus(ObjectStatus value)
		{
			status = value;
		}
Пример #41
0
 public StatusAttribute(ObjectStatus status)
 {
     Status = status;
     //IsSecret = false;
 }
Пример #42
0
 public virtual void Dying(GameTime gameTime)
 {
     if (_diePercent >= 1f)
     {
         _status = ObjectStatus.Dead;
     }
     else
     {
         var dieDelta = (float)(gameTime.ElapsedGameTime.TotalMilliseconds / _dieTime.TotalMilliseconds);
         _diePercent += dieDelta;
     }
 }
Пример #43
0
 public StatusAttribute(ObjectStatus status)
 {
     Status = status;        //позиционный параметр Vip
     //  IsSecret = false;     //по умолчанию и так false
 }
Пример #44
0
 protected BaseObject(ObjectStatus objectStatus)
 {
     _objectStatus = objectStatus;
 }
		public virtual void SetObjectStatus(object obj, ObjectStatus value)
		{
			this.Context.ObjectCloner.EnsureIsClonedIfEditing(obj);
			((IObjectStatusHelper) obj).SetObjectStatus(value);
		}
Пример #46
0
        /// <summary>
        /// 创建一个活体,带有碰撞检测
        /// </summary>
        public LiveObject(Node node,float CreatTime,float DieTime,
            Vector2 center, float width,float height,ContactType ctype,
            ContactDeal td,ContactDeal bd)
            : base(node)
        {
            //drawBoundBox = new DrawBoundBox(this);

            this.toContactDeal = td;
            this.beContactDeal = bd;

            this.Width = width;
            this.Heigth = height;
            this.Center = new Vector2(center.X,-center.Y);
            this.CType = ctype;

            Sce.Pss.HighLevel.GameEngine2D.Scheduler.Instance.Schedule(this, Tick, 0.0f, false);
            this.GodTimer = CreatTime;
            this.DieTime = DieTime;
            this.Born();
            //this.ContactDate = new List<Contacter.Contact>();//碰撞资料
            this.status = ObjectStatus.God;
        }
Пример #47
0
 public void SetObjectStatus(ObjectStatus value)
 {
     this.objectStatusHelperMixin.SetObjectStatus(value);
 }
Пример #48
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="info"></param>
 public DataObjectInfo(ObjectInfo info)
 {
     _Index = info.Index;
     _Name = info.Name;
     _Description = info.Description;
     _ReadOnly = info.ReadOnly;
     _SdoCanRead = info.SdoCanRead;
     _Visible = info.Visible;
     _DisplayedName = info.DisplayedName;
     _MeasureUnit = info.MeasureUnit;
     _Category = info.Category;
     _Value = String.Empty;
     _Modified = DateTime.Now;
     _Status = ObjectStatus.NoError;
 }
Пример #49
0
 public virtual void Die()
 {
     if (_status == ObjectStatus.Active)
     {
         _status = _dieTime != TimeSpan.Zero ? ObjectStatus.Dying : ObjectStatus.Dead;
     }
 }
Пример #50
0
 public virtual void TakeDamage(float damage)
 {
     if(status == ObjectStatus.Live)
     {
         HP -= damage;
         GodTimer += GodTime;
         status = ObjectStatus.God;
     }
 }
Пример #51
0
 public virtual void Initialize()
 {
     _status = ObjectStatus.Active;
 }
Пример #52
0
 public override void UpdateFrame(float dt)
 {
     if(status == ObjectStatus.God)
     {
         GodTimer -= dt;
         if(GodTimer <= 0.0f)
         {
             status = ObjectStatus.Live;
         }
     }
     if(status == ObjectStatus.Live)
     {
         if(CType != ContactType.None)
         {
             Contacter.Instance.Add(this);
         }
     }
     if(status == ObjectStatus.Die)
     {
         DieTime -= dt;
         if(DieTime <= 0.0f)
         {
             Die();
             Remove();
         }
     }
     if(status != ObjectStatus.Die && HP <=0)
     {
         status = ObjectStatus.Die;
     }
 }
Пример #53
0
 public virtual Boolean HasState(ObjectStatus statusFind)
 {
     return ((Status & statusFind) == statusFind);
 }
Пример #54
0
 protected BaseObject(BaseObject status)
 {
     _objectStatus = status._objectStatus;
 }