public static GeomBase createGeom(FightEntity entity, object[] datas, object[] offset = null) { GeomBase result = null; switch (datas.Length) { case 1: result = new GeomCircle(entity.map); break; case 2: result = new GeomRect(entity.map); break; case 3: case 4: result = new GeomSector(entity.map); break; } result.entity = entity; result.parseData(datas, offset); return(result); }