From fe0e71694eef11707fa0de91354a2c6756138bc1 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sat, 30 Apr 2011 05:59:58 +0000 Subject: [PATCH] Squid entity --- .../Source/Entities/EntitySquid.cs | 46 +++++++++++++++++++ Substrate/SubstrateCS/Source/EntityFactory.cs | 1 + 2 files changed, 47 insertions(+) create mode 100644 Substrate/SubstrateCS/Source/Entities/EntitySquid.cs diff --git a/Substrate/SubstrateCS/Source/Entities/EntitySquid.cs b/Substrate/SubstrateCS/Source/Entities/EntitySquid.cs new file mode 100644 index 0000000..ea7d6cb --- /dev/null +++ b/Substrate/SubstrateCS/Source/Entities/EntitySquid.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Substrate.Entities +{ + using Substrate.NBT; + + public class EntitySquid : EntityMob + { + public static readonly NBTCompoundNode SquidSchema = MobSchema.MergeInto(new NBTCompoundNode("") + { + new NBTStringNode("id", "Squid"), + }); + + public EntitySquid () + : base("Squid") + { + } + + public EntitySquid (Entity e) + : base(e) + { + } + + + #region INBTObject Members + + public override bool ValidateTree (TagValue tree) + { + return new NBTVerifier(tree, SquidSchema).Verify(); + } + + #endregion + + + #region ICopyable Members + + public override Entity Copy () + { + return new EntitySquid(this); + } + + #endregion + } +} diff --git a/Substrate/SubstrateCS/Source/EntityFactory.cs b/Substrate/SubstrateCS/Source/EntityFactory.cs index 0ed3417..279da64 100644 --- a/Substrate/SubstrateCS/Source/EntityFactory.cs +++ b/Substrate/SubstrateCS/Source/EntityFactory.cs @@ -79,6 +79,7 @@ namespace Substrate _registry["Slime"] = typeof(EntitySlime); _registry["Snowball"] = typeof(EntitySnowball); _registry["Spider"] = typeof(EntitySpider); + _registry["Squid"] = typeof(EntitySquid); _registry["Wolf"] = typeof(EntityWolf); _registry["Zombie"] = typeof(EntityZombie); }