コード例 #1
0
 public RefData(string name, EComponentType eComponent, object bindVal = null)
 {
     this.name     = name;
     this.bindObj  = null;
     this.bindVal  = bindVal;
     this.TypeName = eComponent.ToString();
 }
コード例 #2
0
 public RefData(string name, EComponentType eComponent, UnityEngine.Object bindObj)
 {
     this.name     = name;
     this.bindObj  = bindObj;
     this.bindVal  = null;
     this.TypeName = eComponent.ToString();
 }
コード例 #3
0
        public static bool HasComponent(Entity *ptr, EComponentType compType)
        {
            var set = _allComponentSet[ptr->_ref._type];

            if (set != null)
            {
                return(set[(int)compType]);
            }
            return(false);
        }
コード例 #4
0
        // Token: 0x060000F1 RID: 241 RVA: 0x00006934 File Offset: 0x00004B34
        private void SetParams(string typeName)
        {
            EComponentType ecomponentType = (EComponentType)Enum.Parse(typeof(EComponentType), typeName);
            bool           flag           = ecomponentType < EComponentType.GameObject;

            if (flag)
            {
                this.bindObj = this.GetGameObject().GetComponent(typeName);
            }
        }
コード例 #5
0
 public ComponentsInfo(EComponentType type, ulong id, TcpClient client, uint timeout, int pThreads = 1, List <string> solvableProblems = null)
 {
     Id                        = id;
     Client                    = client;
     ParallelThreads           = pThreads;
     SolvableProblems          = solvableProblems;
     Type                      = type;
     _apoloniuszTimer          = new Timer(timeout);
     _apoloniuszTimer.Elapsed += OnTimeout;
     _apoloniuszTimer.Start();
 }
コード例 #6
0
        public TimeLineComponent(bool needRealtimeUpdateView, uint identifier, uint objectIdentifier, EComponentType type, DataTimed <T> origin, DataTimed <T> destination = null) : base(identifier, objectIdentifier, type)
        {
            RealtimeViewUpdate = needRealtimeUpdateView;

            m_componentType = type;

            if (origin != null)
            {
                InsertData(origin);
            }
            if (destination != null)
            {
                InsertData(destination);
            }
        }
コード例 #7
0
        public static MonitorLineList GetByComponentList(string componentSerial, EComponentType componentType, CriteriaEx criteria, bool childs)
        {
            QueryConditions conditions = new QueryConditions
            {
                Monitor    = MonitorInfo.New(-1),
                PagingInfo = (criteria != null) ? criteria.PagingInfo : null,
                Filters    = (criteria != null) ? criteria.Filters : null,
                Orders     = (criteria != null) ? criteria.Orders : null
            };

            conditions.Monitor.ComponentSerial = componentSerial;
            conditions.Monitor.ComponentType   = (long)componentType;

            return(GetList(MonitorLine.SELECT_BY_COMPONENT(conditions, false), childs));
        }
コード例 #8
0
ファイル: GameLogic.cs プロジェクト: Suliac/ProjectDeusClient
        private void UpdateTimelineComponent <T, U>(uint objectId, EComponentType componentType, U originValue, uint originTimestampMs, U destinationValue, uint destinationTimestampMs) where T : TimeLineComponent <U>
        {
            DeusComponent component = FindComponent(objectId, componentType);

            if (component != null && component is T)
            {
                if (originValue != null)
                {
                    (component as T).InsertData(originValue, originTimestampMs);
                }

                if (destinationValue != null)
                {
                    (component as T).InsertData(destinationValue, destinationTimestampMs);
                }
            }
        }
コード例 #9
0
        public void Deserialize(byte[] packetsBuffer, ref int index)
        {
            uint tmpComponentId = 0;

            Serializer.DeserializeData(packetsBuffer, ref index, out tmpComponentId);
            ComponentId = tmpComponentId;

            ComponentType = (EComponentType)packetsBuffer[index];
            index++;

            bool thereIsOrigin = false;

            Serializer.DeserializeData(packetsBuffer, ref index, out thereIsOrigin);

            if (thereIsOrigin)
            {
                DataTimed <T> tmpOrigin = new DataTimed <T>();
                Serializer.DeserializeData(packetsBuffer, ref index, out tmpOrigin);
                Origin = tmpOrigin;
            }
            else
            {
                Origin = null;
            }

            bool thereIsDestination = false;

            Serializer.DeserializeData(packetsBuffer, ref index, out thereIsDestination);

            if (thereIsDestination)
            {
                DataTimed <T> tmpDestination = new DataTimed <T>(default(T), 0);
                Serializer.DeserializeData(packetsBuffer, ref index, out tmpDestination);
                Destination = tmpDestination;
            }
            else
            {
                Destination = null;
            }
        }
コード例 #10
0
        /// <summary>
        /// generates id for the component, adds it to an adequate list, and sends returning message
        /// </summary>
        /// <param name="client"></param>
        /// <param name="type"></param>
        /// <param name="parallelThreads"></param>
        /// <param name="solvableProblems"></param>
        public void RegisterComponent(TcpClient client, EComponentType type, int parallelThreads = 1, List <string> solvableProblems = null)
        {
            var componentsInfo = new ComponentsInfo(type, ++_maxComponentId, client, _timeout, parallelThreads, solvableProblems);

            componentsInfo.ComponentTimedOut += componentsInfo_ComponentTimedOut;
            switch (type.ToString())
            {
            case ("TaskManager"):
                _taskManagers.Add(componentsInfo);
                break;

            case ("ComputationalNode"):
                _computationalNodes.Add(componentsInfo);
                break;

            case ("ComputationalClient"):
                _computationalClients.Add(componentsInfo);
                break;
            }
            var responseMsg = new RegisterResponseMessage(_maxComponentId, DateTime.Now);

            SendMessage(responseMsg.Serialize(), client);
            EventLogger.GetLog().InfoFormat("Zarejestrowano {0} z Id:{1}", componentsInfo.Type, componentsInfo.Id);
        }
コード例 #11
0
    // Token: 0x06000017 RID: 23 RVA: 0x00003088 File Offset: 0x00001288
    private RefData GetData(GameObject go)
    {
        bool    flag = go != null;
        RefData result;

        if (flag)
        {
            RefData refData = null;
            for (int i = 0; i < 18; i++)
            {
                EComponentType ecomponentType = (EComponentType)i;
                bool           flag2          = ecomponentType != EComponentType.GameObject;
                if (flag2)
                {
                    Component component = go.GetComponent(ecomponentType.ToString());
                    bool      flag3     = component != null;
                    if (flag3)
                    {
                        refData = new RefData(go.name, ecomponentType, component);
                        break;
                    }
                }
            }
            bool flag4 = refData == null;
            if (flag4)
            {
                refData = new RefData(go.name, EComponentType.GameObject, go);
            }
            result = refData;
        }
        else
        {
            result = null;
        }
        return(result);
    }
コード例 #12
0
 public bool HasComponent(EComponentType compType)
 {
     return(EntityUtil._PlayerCubeComponentSet[(int)compType]);
 }
コード例 #13
0
 public ComponentDialogResult(EComponentType type)
 {
     Type = type;
 }
コード例 #14
0
ファイル: GameLogic.cs プロジェクト: Suliac/ProjectDeusClient
 private DeusComponent FindComponent(uint objectId, EComponentType componentType)
 {
     return(m_holdedObjects.FirstOrDefault(go => go.UniqueIdentifier == objectId)?.GetComponent(componentType) ?? null);
 }
コード例 #15
0
 public void RunComponentType(EComponentType _Type, ControlViewModel obj)
 {
     temp[_Type].Display(obj);
     temp[_Type].Edit1(obj);
     temp[_Type].Edit2(obj);
 }
コード例 #16
0
    private void DrawChild(Rect r, int index, bool selected, bool focused)
    {
        if (index >= m_ReorderLst.serializedProperty.arraySize)
        {
            return;
        }

        var data = m_RefHolder.Datas[index];

        if (string.IsNullOrEmpty(data.TypeName))
        {
            return;
        }

        var element = m_ReorderLst.serializedProperty.GetArrayElementAtIndex(index);

        r.y++;
        r.height = 16;
        Rect[] rects = GetRects(r);
        GUI.color = Color.white;
        if (data.hasVal)
        {
            GUI.color = Color.red;
        }
        else if (m_SearchMatchedData.Contains(data))
        {
            GUI.color = Color.yellow;
        }

        if (GUI.Button(rects[0], index.ToString()))
        {
        }

        data.name = EditorGUI.TextField(rects[1], data.name);
        if (GUI.Button(rects[2], "→"))
        {
            if (data.GetGameObject() != null)
            {
                data.GetGameObject().name = data.name;
                serializedObject.ApplyModifiedProperties();
            }
        }

        EComponentType type = (EComponentType)Enum.Parse(typeof(EComponentType), data.TypeName);

        if (type <= EComponentType.GameObject)
        {
            var obj = EditorGUI.ObjectField(rects[3], data.bindObj, typeof(UnityEngine.Object),
                                            true);
            if (data.bindObj != obj)
            {
                data.bindObj = obj;
                data         = GetData(data.GetGameObject());
                serializedObject.ApplyModifiedProperties();
            }
        }
        else if (type == EComponentType.Number)
        {
            if (data.bindVal.GetType() != typeof(LFloat))
            {
                data.bindVal = LFloat.zero;
            }
            var fVal = EditorGUI.FloatField(rects[3], ((LFloat)data.bindVal).ToFloat());
            data.bindVal = new LFloat(true, (int)fVal * LFloat.Precision);
            ;
        }
        else if (type == EComponentType.Color)
        {
            if (data.bindVal.GetType() != typeof(Color))
            {
                data.bindVal = Color.white;
            }
            data.bindVal = EditorGUI.ColorField(rects[3], (Color)data.bindVal);
        }

        if (!string.IsNullOrEmpty(data.TypeName))
        {
            var comStr = EditorGUI.EnumPopup(rects[4],
                                             (EComponentType)Enum.Parse(typeof(EComponentType), data.TypeName)).ToString();
            if (data.TypeName != comStr)
            {
                data.TypeName = comStr;
                serializedObject.ApplyModifiedProperties();
            }
        }

        if (GUI.Button(rects[5], "×"))
        {
            this.m_ReorderLst.serializedProperty.DeleteArrayElementAtIndex(index);
            serializedObject.ApplyModifiedProperties();
        }

        ;
    }
コード例 #17
0
 public bool HasComponent(EComponentType compType)
 {
     return(EntityUtil._BoidObstacleComponentSet[(int)compType]);
 }
コード例 #18
0
 public static MonitorLineList GetByComponentList(string componentSerial, EComponentType componentType, bool childs)
 {
     return(GetByComponentList(componentSerial, componentType, null, childs));
 }
コード例 #19
0
 public void RunComponentType(EComponentType _Type, ControlViewModel obj)
 {
     temp[_Type].Display(obj);
     temp[_Type].Edit1(obj);
     temp[_Type].Edit2(obj);
 }
コード例 #20
0
    // Token: 0x06000006 RID: 6 RVA: 0x000022DC File Offset: 0x000004DC
    private void DrawChild(Rect r, int index, bool selected, bool focused)
    {
        bool flag = index >= this.m_ReorderLst.serializedProperty.arraySize;

        if (!flag)
        {
            RefData refData = this.m_RefHolder.Datas[index];
            bool    flag2   = string.IsNullOrEmpty(refData.TypeName);
            if (!flag2)
            {
                SerializedProperty arrayElementAtIndex = this.m_ReorderLst.serializedProperty.GetArrayElementAtIndex(index);
                float y = r.y;
                r.y      = y + 1f;
                r.height = 16f;
                Rect[] rects = this.GetRects(r);
                GUI.color = Color.white;
                bool hasVal = refData.hasVal;
                if (hasVal)
                {
                    GUI.color = Color.red;
                }
                else
                {
                    bool flag3 = this.m_SearchMatchedData.Contains(refData);
                    if (flag3)
                    {
                        GUI.color = Color.yellow;
                    }
                }
                bool flag4 = GUI.Button(rects[0], index.ToString());
                if (flag4)
                {
                }
                refData.name = EditorGUI.TextField(rects[1], refData.name);
                bool flag5 = GUI.Button(rects[2], "→");
                if (flag5)
                {
                    bool flag6 = refData.GetGameObject() != null;
                    if (flag6)
                    {
                        refData.GetGameObject().name = refData.name;
                        base.serializedObject.ApplyModifiedProperties();
                    }
                }
                EComponentType ecomponentType = (EComponentType)Enum.Parse(typeof(EComponentType), refData.TypeName);
                bool           flag7          = ecomponentType <= EComponentType.GameObject;
                if (flag7)
                {
                    UnityEngine.Object @object = EditorGUI.ObjectField(rects[3], refData.bindObj, typeof(System.Object), true);
                    bool flag8 = refData.bindObj != @object;
                    if (flag8)
                    {
                        refData.bindObj = @object;
                        refData         = this.GetData(refData.GetGameObject());
                        base.serializedObject.ApplyModifiedProperties();
                    }
                }
                else
                {
                    bool flag9 = ecomponentType == EComponentType.Number;
                    if (flag9)
                    {
                        bool flag10 = refData.bindVal.GetType() != typeof(LFloat);
                        if (flag10)
                        {
                            refData.bindVal = LFloat.zero;
                        }
                        float num = EditorGUI.FloatField(rects[3], ((LFloat)refData.bindVal).ToFloat());
                        refData.bindVal = new LFloat(true, (long)(num * 1000000f));
                    }
                    else
                    {
                        bool flag11 = ecomponentType == EComponentType.Color;
                        if (flag11)
                        {
                            bool flag12 = refData.bindVal.GetType() != typeof(Color);
                            if (flag12)
                            {
                                refData.bindVal = Color.white;
                            }
                            refData.bindVal = EditorGUI.ColorField(rects[3], (Color)refData.bindVal);
                        }
                    }
                }
                bool flag13 = !string.IsNullOrEmpty(refData.TypeName);
                if (flag13)
                {
                    string text   = EditorGUI.EnumPopup(rects[4], (EComponentType)Enum.Parse(typeof(EComponentType), refData.TypeName)).ToString();
                    bool   flag14 = refData.TypeName != text;
                    if (flag14)
                    {
                        refData.TypeName = text;
                        base.serializedObject.ApplyModifiedProperties();
                    }
                }
                bool flag15 = GUI.Button(rects[5], "×");
                if (flag15)
                {
                    this.m_ReorderLst.serializedProperty.DeleteArrayElementAtIndex(index);
                    base.serializedObject.ApplyModifiedProperties();
                }
            }
        }
    }
コード例 #21
0
ファイル: RegisterMessage.cs プロジェクト: Bajena/IO2
 public RegisterMessage(EComponentType componentType, int paralellThreads = 1, List <string> solvableProblems = null)
 {
     ComponentType    = componentType;
     ParallelThreads  = paralellThreads;
     SolvableProblems = solvableProblems ?? new List <string>();
 }
コード例 #22
0
 public DeusViewComponent(IViewableComponent linkedComponent, uint identifier, uint objectIdentifier, EComponentType type) : base(identifier, objectIdentifier, type)
 {
     m_linkedComponent    = linkedComponent;
     m_realtimeUpdateView = m_linkedComponent.RealtimeViewUpdate;
 }
コード例 #23
0
 public bool HasComponent(EComponentType compType)
 {
     return(EntityUtil._BoidSpawnerComponentSet[(int)compType]);
 }