本文整理汇总了C#中TagData类的典型用法代码示例。如果您正苦于以下问题:C# TagData类的具体用法?C# TagData怎么用?C# TagData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagData类属于命名空间,在下文中一共展示了TagData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name PhysicsEntityTag.mass
// @Group General Information
// @ReturnType NumberTag
// @Returns the PhysicsEntity's mass.
// @Example "10" .mass could return "40".
// -->
case "mass":
return new NumberTag(Internal.Mass).Handle(data.Shrink());
// <--[tag]
// @Name PhysicsEntityTag.bounciness
// @Group General Information
// @ReturnType NumberTag
// @Returns the PhysicsEntity's bounciness (how much it bounces).
// @Example "10" .bounciness could return "0.5".
// -->
case "bounciness":
return new NumberTag(Internal.GetBounciness()).Handle(data.Shrink());
default:
return new EntityTag((Entity)Internal).Handle(data);
}
}
示例2: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name EntityTag.iid
// @Group General Information
// @ReturnType NumberTag
// @Returns this entity's instance ID number.
// @Example "2" .iid returns "2".
// -->
case "iid":
return new NumberTag(Internal.GetInstanceID()).Handle(data.Shrink());
// <--[tag]
// @Name EntityTag.location
// @Group Status
// @ReturnType LocationTag
// @Returns the entity's current world position.
// @Example "2" .location returns "(5, 10, 15)".
// -->
case "location":
return new LocationTag(Internal.transform.position).Handle(data.Shrink());
default:
return new TextTag(ToString()).Handle(data.Shrink());
}
}
示例3: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name ResourceTag.asset
// @Group General Information
// @ReturnType ResourceAssetTag
// @Returns the resource asset that this resource is based off.
// @Example "2" .asset returns "Bush_Jade".
// -->
case "asset":
return new ResourceAssetTag(Internal.asset).Handle(data.Shrink());
// <--[tag]
// @Name ResourceTag.health
// @Group General Information
// @ReturnType NumberTag
// @Returns the current health of the resource.
// @Example "2" .health returns "1".
// -->
case "health":
return new NumberTag(Internal.health).Handle(data.Shrink());
default:
return new EntityTag(Internal.model.gameObject).Handle(data);
}
}
示例4: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name BulletEntityTag.damage
// @Group General Information
// @ReturnType NumberTag
// @Returns the amount of damage the BulletEntity will do, not counting splash or other special damage.
// @Example "10" .damage could return "1".
// -->
case "damage":
return new NumberTag(Internal.Damage).Handle(data.Shrink());
// <--[tag]
// @Name BulletEntityTag.splash_size
// @Group General Information
// @ReturnType NumberTag
// @Returns the radius of the BulletEntity's splash damage area in blocks.
// @Example "10" .splash_size could return "0".
// -->
case "splash_size":
return new NumberTag(Internal.SplashSize).Handle(data.Shrink());
default:
return new PrimitiveEntityTag((PrimitiveEntity)Internal).Handle(data);
}
}
示例5: ScanInventory_Form
public ScanInventory_Form(StartAudit_Form appForm)
{
InitializeComponent();
this.m_appForm = appForm;
status = "Connect";
this.m_UpdateReadHandler = new UpdateRead(myUpdateRead);
this.m_UpdateStatusHandler = new UpdateStatus(myUpdateStatus);
this.m_ReadTag = new Symbol.RFID3.TagData();
m_ReaderAPI = m_appForm.m_ReaderAPI;
m_ReaderAPI = new RFIDReader("127.0.0.1", 5084, 0);
this.m_AntennaInfoForm = m_appForm.m_AntennaInfoForm;
this.m_AntennaConfigForm = m_appForm.m_AntennaConfigForm;
this.m_PostFilterForm = m_appForm.m_PostFilterForm;
this.m_AccessFilterForm = m_appForm.m_AccessFilterForm;
this.m_TriggerForm = m_appForm.m_TriggerForm;
this.m_ReaderMgmt = new ReaderManagement();
this.m_TagTable = new Hashtable(1023);
this.m_AccessOpResult = new AccessOperationResult();
this.m_IsConnected = false;
this.m_TagTotalCount = 0;
this.m_ReaderInitiatedDisconnectionReceived = false;
this.m_isBeepingEnabled = true;
}
示例6: EndSerialize
public void EndSerialize(TagStructureInfo info, byte[] data, uint mainStructOffset)
{
_data.MainStructOffset = mainStructOffset;
_data.Data = data;
_cache.SetTagData(_stream, Tag, _data);
_data = null;
}
示例7: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name PrimitiveEntityTag.velocity
// @Group General Information
// @ReturnType LocationTag
// @Returns the PrimitiveEntity's velocity as a LocationTag.
// @Example "10" .velocity could return "(40, 10, 0)".
// -->
case "velocity":
return new LocationTag(Internal.GetVelocity(), null).Handle(data.Shrink());
// <--[tag]
// @Name PrimitiveEntityTag.scale
// @Group General Information
// @ReturnType LocationTag
// @Returns the PrimitiveEntity's scale as a LocationTag.
// @Example "5" .scale could return "(1, 1, 1)".
// -->
case "scale":
return new LocationTag(Internal.Scale, null).Handle(data.Shrink());
default:
return new EntityTag((Entity)Internal).Handle(data);
}
}
示例8: GetClientCalibration
public CalibrationData GetClientCalibration(TagData tag)
{
CalibrationData result = null;
string key = KeyFromTagData(tag);
_calibrations.TryGetValue(key, out result);
return result;
}
示例9: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// TODO: Mode, etc.
// <--[tag]
// @Name RecipeTag.input
// @Group General Information
// @ReturnType ListTag
// @Returns the result of this recipe.
// @Example "blocks/grass|blocks/dirt" .result returns "blocks/dirt|".
// -->
case "input":
{
ListTag list = new ListTag();
for (int i = 0; i < Internal.Input.Length; i++)
{
list.ListEntries.Add(new ItemTag(Internal.Input[i]));
}
return list.Handle(data.Shrink());
}
default:
return new TextTag(ToString()).Handle(data);
}
}
示例10: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name ModelEntityTag.model
// @Group General Information
// @ReturnType TextTag
// @Returns the ModelEntity's model.
// @Example "5" .model could return "cube".
// -->
case "model":
return new TextTag(Internal.model).Handle(data.Shrink());
// <--[tag]
// @Name ModelEntityTag.scale
// @Group General Information
// @ReturnType LocationTag
// @Returns the ModelEntity's scale as a LocationTag.
// @Example "5" .scale could return "(1, 1, 1)".
// -->
case "scale":
return new LocationTag(Internal.scale, null).Handle(data.Shrink());
default:
return new PhysicsEntityTag((PhysicsEntity)Internal).Handle(data);
}
}
示例11: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name MaterialTag.name
// @Group General Information
// @ReturnType TextTag
// @Returns the material's name.
// @Example "stone" .name returns "stone".
// -->
case "name":
return new TextTag(ToString()).Handle(data.Shrink());
// <--[tag]
// @Name MaterialTag.speed_mod
// @Group General Information
// @ReturnType NumberTag
// @Returns the material's speed modification.
// @Example "stone" .speed_mod returns "1.1".
// -->
case "speed_mod":
return new NumberTag(Internal.GetSpeedMod()).Handle(data.Shrink());
// TODO: More tags
default:
return new TextTag(ToString()).Handle(data);
}
}
示例12: Handle
public override TemplateObject Handle(TagData data)
{
long eid;
string input = data.GetModifier(0).ToLowerFast();
if (long.TryParse(input, out eid))
{
Entity e = TheServer.GetEntity(eid);
if (e != null && e is LivingEntity)
{
return new LivingEntityTag((LivingEntity)e).Handle(data.Shrink());
}
}
else
{
foreach (PlayerEntity p in TheServer.Players)
{
if (p.Name.ToLowerFast() == input)
{
return new LivingEntityTag(p).Handle(data.Shrink());
}
}
}
data.Error("Invalid living entity '" + TagParser.Escape(input) + "'!");
return new NullTag();
}
示例13: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name PlayerTag.name
// @Group General Information
// @ReturnType TextTag
// @Returns the player's name.
// @Example "Fortifier" .name returns "Fortifier".
// -->
case "name":
return new TextTag(Internal.Name).Handle(data.Shrink());
// <--[tag]
// @Name PlayerTag.health
// @Group Status
// @ReturnType NumberTag
// @Returns the player's health.
// @Example "Fortifier" .health could return "100".
// -->
case "health":
return new NumberTag(Internal.Health).Handle(data.Shrink());
// <--[tag]
// @Name PlayerTag.is_afk
// @Group Status
// @ReturnType BooleanTag
// @Returns whether the player is AFK (Away From Keyboard) currently.
// @Other this is detected as "no input whatsoever" from the player. Any number of things could potentially knock a player out of "AFK" status.
// -->
case "is_afk":
return new BooleanTag(Internal.IsAFK).Handle(data.Shrink());
// <--[tag]
// @Name PlayerTag.afk_time
// @Group Status
// @ReturnType IntegerTag
// @Returns the amount of time the player has been AFK (Away From Keyboard) currently. This is a number in seconds.
// @Other this is detected as "no input whatsoever" from the player. Any number of things could potentially knock a player out of "AFK" status.
// @Example "mcmonkey" .afk_time could return "5".
// -->
case "afk_time":
return new IntegerTag(Internal.TimeAFK).Handle(data.Shrink());
// <--[tag]
// @Name PlayerTag.held_item
// @Group Status
// @ReturnType ItemTag
// @Returns the item the player is currently holding.
// @Example "mcmonkey" .held_item could return "bullet".
// -->
case "held_item":
return new ItemTag(Internal.Items.GetItemForSlot(Internal.Items.cItem)).Handle(data.Shrink());
default:
return new LivingEntityTag((LivingEntity)Internal).Handle(data);
}
}
示例14: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name AnimalTag.is_alive
// @Group General Information
// @ReturnType BooleanTag
// @Returns whether the animal is still alive.
// @Example "2" .is_alive returns "true".
// -->
case "is_alive":
return new BooleanTag(!Internal.isDead).Handle(data.Shrink());
// <--[tag]
// @Name AnimalTag.name
// @Group General Information
// @ReturnType TextTag
// @Returns the name of the animal's type.
// @Example "2" .name returns "Cow".
// -->
case "name":
return new TextTag(Internal.asset.name).Handle(data.Shrink());
// <--[tag]
// @Name AnimalTag.aid
// @Group General Information
// @ReturnType NumberTag
// @Returns the animal ID number of the animal.
// @Example "2" .aid returns "1".
// -->
case "aid":
return new NumberTag(Internal.index).Handle(data.Shrink());
// <--[tag]
// @Name AnimalTag.health
// @Group General Information
// @ReturnType NumberTag
// @Returns the animal's current health.
// @Example "2" .health returns "96".
// -->
case "health":
return new NumberTag(Internal.health).Handle(data.Shrink());
// <--[tag]
// <--[tag]
// @Name AnimalTag.asset
// @Group General Information
// @ReturnType AnimalAssetTag
// @Returns the animal asset that this animal is based off.
// @Example "2" .asset returns "Cow".
// -->
case "asset":
return new AnimalAssetTag(Internal.asset).Handle(data.Shrink());
default:
return new EntityTag(Internal.gameObject).Handle(data);
}
}
示例15: Handle
public override TemplateObject Handle(TagData data)
{
if (data.Remaining == 0)
{
return this;
}
switch (data[0])
{
// <--[tag]
// @Name VehicleTag.name
// @Group General Information
// @ReturnType TextTag
// @Returns the name of the vehicle's type.
// @Example "2" .name returns "APC_Forest".
// -->
case "name":
return new TextTag(Internal.asset.name).Handle(data.Shrink());
// <--[tag]
// @Name VehicleTag.vid
// @Group General Information
// @ReturnType NumberTag
// @Returns the vehicle ID number of the vehicle.
// @Example "2" .vid returns "1".
// -->
case "vid":
return new NumberTag(Internal.id).Handle(data.Shrink());
// <--[tag]
// @Name VehicleTag.asset
// @Group General Information
// @ReturnType VehicleAssetTag
// @Returns the vehicle asset that this vehicle is based off.
// @Example "2" .asset returns "APC_Forest".
// -->
case "asset":
return new VehicleAssetTag(Internal.asset).Handle(data.Shrink());
// <--[tag]
// @Name VehicleTag.health
// @Group General Information
// @ReturnType NumberTag
// @Returns the current health of the vehicle.
// @Example "2" .health returns "99".
// -->
case "health":
return new NumberTag(Internal.health).Handle(data.Shrink());
// <--[tag]
// @Name VehicleTag.id
// @Group General Information
// @ReturnType NumberTag
// @Returns the current amount of fuel in the vehicle.
// @Example "2" .fuel returns "67".
// -->
case "fuel":
return new NumberTag(Internal.fuel).Handle(data.Shrink());
default:
return new EntityTag(Internal.gameObject).Handle(data);
}
}