public static Entity Clone(Entity entity)
{
Entity clone = null;
if (entity is StaticModelEntity)
{
StaticModelEntity modelentity = entity as StaticModelEntity;
clone = new StaticModelEntity(modelentity.GetModel());
}
if (entity is WallModelEntity)
{
WallModelEntity wallentity = entity as WallModelEntity;
clone = new WallModelEntity(wallentity.GetModel());
}
if (entity is AnimatedModelEntity)
{
AnimatedModelEntity modelentity = entity as AnimatedModelEntity;
clone = new AnimatedModelEntity(modelentity.GetModel());
}
if (entity is Billboard)
{
Billboard billboard = entity as Billboard;
clone = new Billboard(billboard.region);
}
if (clone != null)
{
CopyFrom(entity, clone);
}
return(clone);
}