2011-04-06 19:41:57 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2011-04-06 21:20:35 +00:00
|
|
|
|
namespace Substrate.Entities
|
2011-04-06 19:41:57 +00:00
|
|
|
|
{
|
2011-06-30 04:41:29 +00:00
|
|
|
|
using Substrate.Nbt;
|
2011-04-06 19:41:57 +00:00
|
|
|
|
|
|
|
|
|
public class EntityPigZombie : EntityMob
|
|
|
|
|
{
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public static readonly SchemaNodeCompound PigZombieSchema = MobSchema.MergeInto(new SchemaNodeCompound("")
|
2011-04-06 19:41:57 +00:00
|
|
|
|
{
|
2011-11-05 18:17:57 +00:00
|
|
|
|
new SchemaNodeString("id", TypeId),
|
2011-07-07 04:27:48 +00:00
|
|
|
|
new SchemaNodeScaler("Anger", TagType.TAG_SHORT),
|
2011-04-06 19:41:57 +00:00
|
|
|
|
});
|
|
|
|
|
|
2011-11-05 18:17:57 +00:00
|
|
|
|
public static string TypeId
|
|
|
|
|
{
|
|
|
|
|
get { return "PigZombie"; }
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-07 04:27:48 +00:00
|
|
|
|
private short _anger;
|
|
|
|
|
|
|
|
|
|
public int Anger
|
|
|
|
|
{
|
|
|
|
|
get { return _anger; }
|
|
|
|
|
set { _anger = (short)value; }
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-05 18:17:57 +00:00
|
|
|
|
protected EntityPigZombie (string id)
|
|
|
|
|
: base(id)
|
2011-04-06 19:41:57 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-05 18:17:57 +00:00
|
|
|
|
public EntityPigZombie ()
|
|
|
|
|
: this(TypeId)
|
2011-11-05 17:36:04 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-14 19:34:49 +00:00
|
|
|
|
public EntityPigZombie (TypedEntity e)
|
2011-04-06 19:41:57 +00:00
|
|
|
|
: base(e)
|
|
|
|
|
{
|
2011-07-07 04:27:48 +00:00
|
|
|
|
EntityPigZombie e2 = e as EntityPigZombie;
|
|
|
|
|
if (e2 != null) {
|
|
|
|
|
_anger = e2._anger;
|
|
|
|
|
}
|
2011-04-06 19:41:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region INBTObject<Entity> Members
|
|
|
|
|
|
2011-08-14 19:34:49 +00:00
|
|
|
|
public override TypedEntity LoadTree (TagNode tree)
|
2011-07-07 04:27:48 +00:00
|
|
|
|
{
|
|
|
|
|
TagNodeCompound ctree = tree as TagNodeCompound;
|
|
|
|
|
if (ctree == null || base.LoadTree(tree) == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_anger = ctree["Anger"].ToTagShort();
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override TagNode BuildTree ()
|
|
|
|
|
{
|
|
|
|
|
TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
|
|
|
|
|
tree["Anger"] = new TagNodeShort(_anger);
|
|
|
|
|
|
|
|
|
|
return tree;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public override bool ValidateTree (TagNode tree)
|
2011-04-06 19:41:57 +00:00
|
|
|
|
{
|
2011-06-30 04:57:18 +00:00
|
|
|
|
return new NbtVerifier(tree, PigZombieSchema).Verify();
|
2011-04-06 19:41:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region ICopyable<Entity> Members
|
|
|
|
|
|
2011-08-14 19:34:49 +00:00
|
|
|
|
public override TypedEntity Copy ()
|
2011-04-06 19:41:57 +00:00
|
|
|
|
{
|
|
|
|
|
return new EntityPigZombie(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|