예제 #1
0
 public void InitComponent(IAttributeTable attributeTable)
 {
     Crouching             = false;
     ScaleFactorMoving     = DefaultScaleFactorMoving;
     ScaleFactorStationary = DefaultScaleFactorStationary;
     Speed = DefaultSpeed;
 }
예제 #2
0
        public static void BlueprintComponentsField(
            Blueprint blueprint,
            IAttributeTable configuration,
            InspectorTypeTable inspectorTypeTable,
            IBlueprintManager blueprintManager)
        {
            // Compute maximum label width.
            float maxLabelWidth = 0;

            foreach (var componentType in blueprint.GetAllComponentTypes())
            {
                var inspectorType = inspectorTypeTable[componentType];
                foreach (var componentProperty in inspectorType.Properties)
                {
                    var textDimensions = GUI.skin.label.CalcSize(new GUIContent(componentProperty.Name));
                    maxLabelWidth = MathUtils.Max(textDimensions.x, maxLabelWidth);
                }
            }
            EditorGUIUtility.labelWidth = maxLabelWidth;

            foreach (var componentType in blueprint.GetAllComponentTypes())
            {
                var inspectorType = inspectorTypeTable[componentType];

                // Draw inspector.
                AttributeTableField(inspectorType, configuration, inspectorTypeTable, blueprintManager);
            }
        }
예제 #3
0
 /// <summary>
 ///   Adds all content of the passed attribute table to this one.
 /// </summary>
 /// <param name="attributeTable"> Table to add the content of. </param>
 public void AddRange(IAttributeTable attributeTable)
 {
     foreach (KeyValuePair <object, object> keyValuePair in attributeTable)
     {
         this.SetValue(keyValuePair.Key, keyValuePair.Value);
     }
 }
예제 #4
0
 public static void RelateTableLayer(ILayer ilayer_0, string string_0, ITable itable_0, string string_1)
 {
     try
     {
         IAttributeTable table = ilayer_0 as IAttributeTable;
         if (table != null)
         {
             ITable attributeTable = table.AttributeTable;
             if (itable_0 is IStandaloneTable)
             {
                 itable_0 = (itable_0 as IStandaloneTable).Table;
             }
             IMemoryRelationshipClassFactory factory = new MemoryRelationshipClassFactoryClass();
             IRelationshipClass relationshipClass    = factory.Open("TabletoLayer", (IObjectClass)itable_0,
                                                                    string_1, (IObjectClass)attributeTable, string_0, "forward", "backward",
                                                                    esriRelCardinality.esriRelCardinalityOneToMany);
             ((IRelationshipClassCollectionEdit)ilayer_0).AddRelationshipClass(relationshipClass);
         }
     }
     catch (COMException exception)
     {
         MessageBox.Show(exception.Message, "COM Error: " + exception.ErrorCode.ToString(), MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation);
     }
     catch (Exception exception2)
     {
         MessageBox.Show(exception2.Message, ".NET Error: ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
예제 #5
0
        /// <summary>
        ///   Creates a new entity, adding components matching the passed
        ///   blueprint and initializing these with the data stored in the
        ///   blueprint and the specified configuration. Configuration data
        ///   is preferred over blueprint data.
        /// </summary>
        /// <param name="blueprint"> Blueprint describing the entity to create. </param>
        /// <param name="configuration"> Data for initializing the entity. </param>
        /// <param name="additionalComponents">Components to add to the entity, in addition to the ones specified by the blueprint.</param>
        /// <returns> Unique id of the new entity. </returns>
        public int CreateEntity(Blueprint blueprint, IAttributeTable configuration, List <Type> additionalComponents)
        {
            int id = this.CreateEntity();

            this.InitEntity(id, blueprint, configuration, additionalComponents);
            return(id);
        }
예제 #6
0
        public void SetTableSource(IFeatureSet fs, int layerHandle, bool ogr)
        {
            if (fs == null)
            {
                RowCount = 0;
                return;
            }

            _layerHandle = layerHandle;
            _shapefile   = fs;
            _table       = fs.Table;
            _ogr         = ogr;

            InitColumns(_table);

            RowManager.Reset(_shapefile);

            RowCount = 0;

            // this will clear all rows at once or else it will try to remove them one by one (veeeery slow)
            RowCount = _table.NumRows;

            bool editing = _shapefile.CanEditTable();

            ReadOnly = !editing;
        }
예제 #7
0
 public static void RelateTableLayer(ILayer pSrcLayer, string pSrcFieldName, ITable pToTable, string pToFieldName)
 {
     try
     {
         IAttributeTable table = pSrcLayer as IAttributeTable;
         if (table != null)
         {
             ITable attributeTable = table.AttributeTable;
             if (pToTable is IStandaloneTable)
             {
                 pToTable = (pToTable as IStandaloneTable).Table;
             }
             IMemoryRelationshipClassFactory factory = new MemoryRelationshipClassFactoryClass();
             IRelationshipClass relationshipClass    = factory.Open("TabletoLayer", (IObjectClass)pToTable,
                                                                    pToFieldName, (IObjectClass)attributeTable, pSrcFieldName, "forward", "backward",
                                                                    esriRelCardinality.esriRelCardinalityOneToMany);
             ((IRelationshipClassCollectionEdit)pSrcLayer).AddRelationshipClass(relationshipClass);
         }
     }
     catch (COMException exception)
     {
         MessageBox.Show(exception.Message, "COM Error: " + exception.ErrorCode.ToString(), MessageBoxButtons.OK,
                         MessageBoxIcon.Exclamation);
     }
     catch (Exception exception2)
     {
         MessageBox.Show(exception2.Message, ".NET Error: ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
        /// <summary>
        ///   Draws the game configuration inspector.
        /// </summary>
        public override void OnInspectorGUI()
        {
            this.DrawDefaultInspector();

            // Collect system types.
            if (this.inspectorSystemTypes == null)
            {
                this.inspectorSystemTypes = InspectorTypeTable.FindInspectorTypes(typeof(ISystem));
            }

            IAttributeTable configuration = this.gameConfiguration.Configuration;

            foreach (var inspectorType in this.inspectorSystemTypes)
            {
                // Draw inspector type.
                this.DrawInspector(inspectorType, configuration, this.inspectorSystemTypes, null);
            }

            if (GUILayout.Button("Reload"))
            {
                // Reload configuration.
                this.gameConfiguration.Load();
            }

            if (GUILayout.Button("Save"))
            {
                // Save configuration.
                // TODO(co): Save automatically if changed.
                this.Save();

                // Refresh assets.
                AssetDatabase.Refresh();
            }
        }
예제 #9
0
 public void GetUniqueValues(ILayer ilayer_1, string string_2, IList ilist_1)
 {
     try
     {
         IAttributeTable table = ilayer_1 as IAttributeTable;
         if (table != null)
         {
             ITable       attributeTable = table.AttributeTable;
             IQueryFilter queryFilter    = new QueryFilterClass
             {
                 WhereClause = "1=1"
             };
             (queryFilter as IQueryFilterDefinition).PostfixClause = "Order by " + string_2;
             ICursor         cursor     = attributeTable.Search(queryFilter, false);
             IDataStatistics statistics = new DataStatisticsClass
             {
                 Field  = string_2,
                 Cursor = cursor
             };
             IEnumerator uniqueValues = statistics.UniqueValues;
             uniqueValues.Reset();
             while (uniqueValues.MoveNext())
             {
                 this.arrayList_0.Add(uniqueValues.Current);
             }
             this.arrayList_0.Sort();
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
 }
예제 #10
0
        /// <summary>
        ///   Tries to get the value of the attribute with the specified key. If not found,
        ///   the specified default value is returned.
        /// </summary>
        /// <typeparam name="T">Expected type of attribute. Only classes are allowed as the method wouldn't be AOT compatible otherwise.</typeparam>
        /// <param name="attributeTable">Attribute table to work on.</param>
        /// <param name="key"> Key to retrieve the value of. </param>
        /// <param name="defaultValue">Default value to use if attribute wasn't found.</param>
        /// <returns>Value of attribute with specified key, if found. Specified default value otherwise.</returns>
        public static T GetValueOrDefault <T>(this IAttributeTable attributeTable, object key, T defaultValue)
            where T : class
        {
            T value;

            return(TryGetValue(attributeTable, key, out value) ? value : defaultValue);
        }
예제 #11
0
        private static void CopyFields(DataTable dt, IAttributeTable tableToFill)
        {
            for (var i = 0; i < dt.Columns.Count; i++)
            {
                var type = AttributeType.String;

                switch (dt.Columns[i].DataType.ToString())
                {
                case "System.String":
                    type = AttributeType.String;
                    break;

                case "System.Double":
                    type = AttributeType.Double;
                    break;

                case "System.Int32":
                    type = AttributeType.Integer;
                    break;
                }

                var fld = new AttributeField {
                    Name = dt.Columns[i].ColumnName, Type = type, Precision = 6,
                };

                if (dt.Columns[i].MaxLength != -1)
                {
                    fld.Width = dt.Columns[i].MaxLength;
                }

                tableToFill.Fields.Add(fld);
            }
        }
예제 #12
0
        /// <summary>
        ///   Draws an inspector for the passed attribute table.
        /// </summary>
        /// <param name="inspectorType">Type to draw inspector controls for.</param>
        /// <param name="attributeTable">Attribute to draw inspector for.</param>
        /// <param name="inspectorTypeTable"></param>
        /// <param name="blueprintManager"></param>
        public static void AttributeTableField(
            InspectorType inspectorType,
            IAttributeTable attributeTable,
            InspectorTypeTable inspectorTypeTable,
            IBlueprintManager blueprintManager)
        {
            foreach (var inspectorProperty in inspectorType.Properties)
            {
                // Get current value.
                object currentValue = attributeTable.GetValueOrDefault(
                    inspectorProperty.Name,
                    inspectorProperty.Default);

                // Draw inspector property.
                object newValue = LogicInspectorPropertyField(
                    inspectorProperty,
                    currentValue,
                    inspectorTypeTable,
                    blueprintManager);

                // Set new value if changed.
                if (!Equals(newValue, currentValue))
                {
                    attributeTable.SetValue(inspectorProperty.Name, newValue);
                }
            }
        }
예제 #13
0
        /// <summary>
        /// Stops currently selected join.
        /// </summary>
        public static bool StopJoin(IAttributeTable table, FieldJoin join)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }

            if (join == null)
            {
                MessageService.Current.Info("No join is selected.");
                return(false);
            }

            string filename = join.Filename;

            if (!MessageService.Current.Ask("Do you want to stop the join: " + filename + "?"))
            {
                return(false);
            }

            if (table.StopJoin(join.JoinIndex))
            {
                filename = Path.GetFileName(filename);
                MessageService.Current.Info("Join was stopped: " + filename);
                return(true);
            }

            return(false);
        }
예제 #14
0
        public static void CreateSystem <T>(out EventManager eventManager, IAttributeTable configuration)
            where T : ISystem, new()
        {
            EntityManager tmp;

            CreateSystem <T>(out eventManager, out tmp, configuration);
        }
예제 #15
0
 public override void Init(IAttributeTable configuration)
 {
     this.EventManager.RegisterListener(RPGGameEvent.PickedLock, OnPickedLock);
     this.EventManager.RegisterListener(RPGGameEvent.TrapDetection, OnTrapDetection);
     this.EventManager.RegisterListener(RPGGameEvent.TrapDetonated, OnTrapDetonated);
     this.EventManager.RegisterListener(RPGGameEvent.TrapDisarmAttempt, OnTrapDisarmAttempt);
 }
        public override void Init(IAttributeTable configuration)
        {
            base.Init(configuration);

            this.EventManager.RegisterListener(SerializationAction.Save, this.OnSave);
            this.EventManager.RegisterListener(SerializationAction.Load, this.OnLoad);
        }
예제 #17
0
        public override void Init(IAttributeTable configuration)
        {
            base.Init(configuration);

            this.EventManager.RegisterListener(SerializationAction.Save, this.OnSave);
            this.EventManager.RegisterListener(SerializationAction.Load, this.OnLoad);
        }
예제 #18
0
 public UpdateJoinEventArgs(string filename, string fieldList, string options, IAttributeTable tableToFill)
 {
     Filename    = filename;
     FieldList   = fieldList;
     Options     = options;
     TableToFill = tableToFill;
 }
예제 #19
0
        public bool ReloadExternal(IAttributeTable table, string joinOptions)
        {
            External = table;

            RestoreSelectedOption(joinOptions);

            return(ReloadExternal(table));
        }
예제 #20
0
        /// <summary>
        /// Fills table with data obtained by ADO.NET provider
        /// </summary>
        /// <param name="dt"> Data table to make the data from </param>
        /// <param name="tableToFill"> MapWinGIS table to copy the data to </param>
        public static void FillMapWinGisTable(DataTable dt, IAttributeTable tableToFill)
        {
            tableToFill.CreateNew(string.Empty);

            CopyFields(dt, tableToFill);

            CopyValues(dt, tableToFill);
        }
예제 #21
0
        /// <summary>
        ///   Inserts the passed attribute table as parent to be consulted with
        ///   the specified priority if a key can't be found in this one.
        /// </summary>
        /// <param name="priority">Priority of the new parent.</param>
        /// <param name="parent">Parent to add.</param>
        public void InsertParent(int priority, IAttributeTable parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "Parent is null.");
            }

            this.parents.Insert(priority, parent);
        }
예제 #22
0
        public static void CreateSystem <T>(
            out EventManager eventManager, out EntityManager entityManager, IAttributeTable configuration)
            where T : ISystem, new()
        {
            var game = CreateGameWithSystem <T>(configuration);

            eventManager  = game.EventManager;
            entityManager = game.EntityManager;
        }
예제 #23
0
        public override void Init(IAttributeTable configuration)
        {
            base.Init(configuration);

            this.EventManager.RegisterListener(WeaponAction.Fire, this.OnFire);
            this.EventManager.RegisterListener(WeaponAction.Reload, this.OnReload);

            this.weaponEntities = new CompoundEntities<WeaponEntity>(this.EntityManager);
        }
예제 #24
0
        public JoinViewModel(IAttributeTable table)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }

            Table = table;
        }
예제 #25
0
        /// <summary>
        ///   Adds the passed attribute table as parent to this one.
        /// </summary>
        /// <param name="parent">Parent to add.</param>
        public void AddParent(IAttributeTable parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "Parent is null.");
            }

            this.parents.Add(parent);
        }
예제 #26
0
        public static IEnumerable <ValueCountItem> GetUniqueValues(this IAttributeTable table, int fieldIndex)
        {
            var hashTable = new SortedDictionary <object, int>();

            var type = table.Fields[fieldIndex].Type;

            for (int i = 0; i < table.NumRows; i++)
            {
                var obj = table.CellValue(fieldIndex, i);

                switch (type)
                {
                case AttributeType.String:
                    string s = obj != null?obj.ToString() : string.Empty;

                    s   = "\"" + s + "\"";
                    obj = s;
                    break;

                case AttributeType.Integer:
                    obj = obj ?? 0;
                    break;

                case AttributeType.Double:
                    obj = obj ?? 0.0;
                    break;

                case AttributeType.Boolean:
                    obj = obj ?? false;
                    break;
                }

                if (hashTable.ContainsKey(obj))
                {
                    hashTable[obj] += 1;
                }
                else
                {
                    hashTable.Add(obj, 1);
                }
            }

            switch (type)
            {
            case AttributeType.String:
                return(hashTable.Select(item => new ValueCountItem(item.Key.ToString(), item.Value)));

            case AttributeType.Integer:
                return(hashTable.Select(item => new ValueCountItem((int)item.Key, item.Value)));

            case AttributeType.Double:
                return(hashTable.Select(item => new ValueCountItem((double)item.Key, item.Value)));
            }

            return(new List <ValueCountItem>());
        }
예제 #27
0
        public FieldStatsModel(IAttributeTable table, int fieldIndex)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }

            Table      = table;
            FieldIndex = fieldIndex;
        }
예제 #28
0
        /// <summary>
        /// Called before view is shown. Allows to initialize UI from this.Model property.
        /// </summary>
        public void Initialize()
        {
            _table = Model.FeatureSet.Table;

            InitFieldGrid();

            InitValuesGrid();

            ShowValues();
        }
        private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext;
            InspectorDataAttribute inspectorDataAttribute = (InspectorDataAttribute)dataContext.InspectorProperty;

            this.value = (IAttributeTable)dataContext.Value;
            this.inspectorFactory = new InspectorFactory(dataContext.EditorContext, null);

            InspectorType typeInfo = InspectorType.GetInspectorType(inspectorDataAttribute.PropertyType);
            this.inspectorFactory.AddInspectorControls(typeInfo, this.Controls, this.GetPropertyValue, this.OnPropertyValueChanged, false);
        }
예제 #30
0
 public bool GetUniqueValues(ILayer ilayer_1, string string_0, IList ilist_1)
 {
     try
     {
         ITable displayTable = null;
         if (ilayer_1 is IDisplayTable)
         {
             displayTable = (ilayer_1 as IDisplayTable).DisplayTable;
         }
         else
         {
             IAttributeTable table2 = ilayer_1 as IAttributeTable;
             if (table2 != null)
             {
                 displayTable = table2.AttributeTable;
             }
             else
             {
                 displayTable = ilayer_1 as ITable;
             }
         }
         if (displayTable == null)
         {
             return(false);
         }
         ICursor         o          = displayTable.Search(null, false);
         IDataStatistics statistics = new DataStatisticsClass
         {
             Field  = string_0,
             Cursor = o
         };
         if ((statistics.UniqueValueCount > 500) &&
             (MessageBox.Show("唯一值数大于500,是否继续", "提示", MessageBoxButtons.YesNo) == DialogResult.No))
         {
             Marshal.ReleaseComObject(o);
             o = null;
             return(false);
         }
         this.bool_1 = true;
         IEnumerator uniqueValues = statistics.UniqueValues;
         uniqueValues.Reset();
         while (uniqueValues.MoveNext())
         {
             this.ilist_0.Add(uniqueValues.Current);
         }
         (this.ilist_0 as ArrayList).Sort();
         return(true);
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
     return(false);
 }
예제 #31
0
 public void InitComponent(IAttributeTable attributeTable)
 {
     PickLockAttempts_Failed  = 0;
     PickLockAttempts_Success = 0;
     PickLockLevel            = 1;
     TrapDetectionLevel       = 10;
     TrapDetections_Failed    = 0;
     TrapDetections_Success   = 0;
     TrapDetonations          = 0;
     TrapDisarmLevel          = 10;
 }
        /// <summary>
        ///   Initializes the specified object via reflection with the specified property value.
        /// </summary>
        /// <param name="entityManager">Entity manager.</param>
        /// <param name="obj">Object to set property value for.</param>
        /// <param name="propertyValue">Property value to set.</param>
        public override void SetPropertyValue(EntityManager entityManager, object obj, object propertyValue)
        {
            IAttributeTable propertyAttributeTable = (IAttributeTable)propertyValue;

            propertyValue = Activator.CreateInstance(this.PropertyType);
            InspectorType propertyInspectorType = InspectorType.GetInspectorType(this.PropertyType);

            InspectorUtils.InitFromAttributeTable(entityManager, propertyInspectorType, propertyValue, propertyAttributeTable);

            base.SetPropertyValue(entityManager, obj, propertyValue);
        }
예제 #33
0
 public override void Init(IAttributeTable configuration)
 {
     EventManager.RegisterListener(RPGGameEvent.FallLanded, OnFallLanded);
     EventManager.RegisterListener(RPGGameEvent.FallStarted, OnFallStarted);
     EventManager.RegisterListener(RPGGameEvent.JumpStarted, OnJumpStarted);
     EventManager.RegisterListener(RPGGameEvent.Menu_Close, OnMenuClose);
     EventManager.RegisterListener(RPGGameEvent.Menu_DisarmTrap, OnMenuDisarmTrap);
     EventManager.RegisterListener(RPGGameEvent.Menu_Open, OnMenuOpen);
     EventManager.RegisterListener(RPGGameEvent.Menu_PickLock, OnMenuPickLock);
     EventManager.RegisterListener(RPGGameEvent.Menu_UseKey, OnMenuUseKey);
 }
        private void OnPropertyValueChanged(InspectorPropertyAttribute inspectorProperty, object newValue)
        {
            if (this.value == null)
            {
                this.value = new AttributeTable();
            }

            this.value.SetValue(inspectorProperty.Name, newValue);
            
            InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext;
            dataContext.Value = this.value;
        }
        private void DrawInspector(InspectorType inspectorType, IAttributeTable configuration, InspectorTypeTable inspectorTypeTable, IBlueprintManager blueprintManager)
        {
            foreach (var inspectorProperty in inspectorType.Properties)
            {
                // Get current value.
                object currentValue = configuration.GetValueOrDefault(inspectorProperty.Name, inspectorProperty.Default);
                object newValue = EditorGUIUtils.LogicInspectorPropertyField(inspectorProperty, currentValue, inspectorTypeTable, blueprintManager);

                // Set new value if changed.
                if (!Equals(newValue, currentValue))
                {
                    configuration.SetValue(inspectorProperty.Name, newValue);
                }
            }
        }
        /// <summary>
        ///   Loads the current game configuration from the resource at <see cref="ConfigurationFilePath" />.
        /// </summary>
        public void Load()
        {
            Debug.Log("Loading game configuration from resources at " + this.ConfigurationFilePath);

            this.configurationFile = (TextAsset)Resources.Load(this.ConfigurationFilePath);
            if (this.configurationFile == null)
            {
                Debug.LogWarning("No configuration file at " + this.ConfigurationFilePath);
                this.Configuration = new AttributeTable();
                return;
            }

            XmlSerializer xmlSerializer = new XmlSerializer(typeof(AttributeTable));
            this.Configuration =
                (IAttributeTable)xmlSerializer.Deserialize(new StringReader(this.configurationFile.text));
        }
예제 #37
0
 /// <summary>
 ///   Initializes this component with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="attributeTable">Component data.</param>
 public void InitComponent(IAttributeTable attributeTable)
 {
     this.value = (TestEnum)attributeTable.GetEnumOrDefault(AttributeValue, DefaultValue);
 }
예제 #38
0
        public override void Init(IAttributeTable configuration)
        {
            base.Init(configuration);

            this.movementEntities = new CompoundEntities<MovementEntity>(this.EntityManager);
        }
 public CreateEntityProcess(string blueprintId, IAttributeTable attributeTable)
 {
     this.blueprintId = blueprintId;
     this.attributeTable = attributeTable;
 }
예제 #40
0
 /// <summary>
 ///   Initializes this system with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="configuration">System configuration data.</param>
 public virtual void Init(IAttributeTable configuration)
 {
     // Initialize from configuration.
     InspectorUtils.InitFromAttributeTable(this.EntityManager, this, configuration);
 }
예제 #41
0
 /// <summary>
 ///   Initializes this component with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="attributeTable">Component data.</param>
 public void InitComponent(IAttributeTable attributeTable)
 {
     this.ListInt = attributeTable.GetValueOrDefault(AttributeListInt, DefaultListInt);
 }
        /// <summary>
        ///   Inserts the passed attribute table as parent to be consulted with
        ///   the specified priority if a key can't be found in this one.
        /// </summary>
        /// <param name="priority">Priority of the new parent.</param>
        /// <param name="parent">Parent to add.</param>
        public void InsertParent(int priority, IAttributeTable parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "Parent is null.");
            }

            this.parents.Insert(priority, parent);
        }
 /// <summary>
 ///   Removes the passed parent from this attribute table.
 /// </summary>
 /// <param name="parent">Parent to remove.</param>
 public void RemoveParent(IAttributeTable parent)
 {
     this.parents.Remove(parent);
 }
 /// <summary>
 ///   Checks whether the passed attribute table is a parent of this one.
 /// </summary>
 /// <param name="parent">Table to check.</param>
 /// <returns>true, if the passed table is a parent of this one, and false otherwise.</returns>
 public bool HasParent(IAttributeTable parent)
 {
     return this.parents.Contains(parent);
 }
예제 #45
0
 /// <summary>
 ///   Initializes this component with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="attributeTable">Component data.</param>
 public void InitComponent(IAttributeTable attributeTable)
 {
     attributeTable.TryGetInt(AttributeInteger, out this.integer);
 }
예제 #46
0
 /// <summary>
 ///   Initializes this component with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="attributeTable">Component data.</param>
 public void InitComponent(IAttributeTable attributeTable)
 {
     attributeTable.TryGetFloat(AttributeValue, out this.value);
 }
 public void InitComponent(IAttributeTable attributeTable)
 {
 }
예제 #48
0
 /// <summary>
 ///   Initializes this component with the data stored in the specified
 ///   attribute table.
 /// </summary>
 /// <param name="attributeTable">Component data.</param>
 public void InitComponent(IAttributeTable attributeTable)
 {
     this.String = (string)attributeTable.GetValue(AttributeString);
 }
 /// <summary>
 ///   Adds all content of the passed attribute table to this one.
 /// </summary>
 /// <param name="other"> Table to add the content of. </param>
 public void AddRange(IAttributeTable other)
 {
     this.attributeTable.AddRange(other);
 }
        /// <summary>
        ///   Adds the passed attribute table as parent to this one.
        /// </summary>
        /// <param name="parent">Parent to add.</param>
        public void AddParent(IAttributeTable parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent", "Parent is null.");
            }

            this.parents.Add(parent);
        }
예제 #51
0
        public override void Init(IAttributeTable configuration)
        {
            base.Init(configuration);

            this.EventManager.RegisterListener(FrameworkEvent.GameStarted, this.OnGameStarted);
        }