Difference between revisions of "Talk:ThingDef/.xml notation "attributes" are actually elements/reply (3)"

From RimWorld Wiki
Jump to navigation Jump to search
 
m
 
Line 5: Line 5:
 
The term variable covers both of them.
 
The term variable covers both of them.
  
A C# attribute is a tag attached to a field, class, or some other part of the code. Attributes can be things like "this should be saved".
+
A C# attribute is a tag attached to a field, class, or some other part of the code. Attributes can be things like "This should be saved" or "When loading, this has alternate name X".
  
 
In XML, an attribute is a piece of data attached to an element like this: <ElementName AttributeName="AttributeValue">Inner elements here</ElementName>
 
In XML, an attribute is a piece of data attached to an element like this: <ElementName AttributeName="AttributeValue">Inner elements here</ElementName>
 +
 +
So yeah, there are some overlapping terms there :/.

Latest revision as of 01:32, 3 May 2014

In C# a field is a raw piece of data held by a class.

A property is a sort of virtual field. It looks like a field, but reading or writing to it actually invoke little methods.

The term variable covers both of them.

A C# attribute is a tag attached to a field, class, or some other part of the code. Attributes can be things like "This should be saved" or "When loading, this has alternate name X".

In XML, an attribute is a piece of data attached to an element like this: <ElementName AttributeName="AttributeValue">Inner elements here</ElementName>

So yeah, there are some overlapping terms there :/.