public IEditorPlaceable CreateObject(CellType type, ObjectStartInfo startInfo) { IEditorPlaceable newItem; if (type == CellType.Coin) { newItem = new Coin(); } else if (type == CellType.Snake) { newItem = new Snake(); } else if (type == CellType.Grapeman) { newItem = new Grapeman(); } else if (type == CellType.Slime) { newItem = new Slime(); } else if (type == CellType.Elf) { newItem = new Elf(); } else if (type == CellType.MrSkeltal) { newItem = new MrSkeltal(); } else if (type == CellType.Rogue) { newItem = new Rogue(); } else { throw new NotImplementedException(); } newItem.Position.Center = new Vector2(startInfo.X, startInfo.Y); return(newItem); }
public ElfController(Elf elf) { Elf = elf; Elf.Scene.AddObject(this); }