// Remove all tile checking code public void Spawn(Item[] newItems, int itemsPerLine = 10, bool forceFlag32 = true) { int totalXTiles = itemsPerLine * 2; int x = SpawnX; int y = SpawnY; for (int i = 0; i < newItems.Length; ++i) { var currItem = newItems[i]; x = SpawnX + ((i * 2) % totalXTiles); y = SpawnY + ((i / itemsPerLine) * 2); var tile = ItemLayer.GetTile(x, y); if (!currItem.IsNone) { tile.CopyFrom(currItem); if (forceFlag32) { tile.SystemParam = 0x20; } ItemLayer.SetExtensionTiles(tile, x, y); } else { tile.Delete(); ItemLayer.DeleteExtensionTiles(tile, x, y); } } }
public static void DeleteExtensionTiles(this FieldItemLayer layer, Item tile, Point itemPt) => layer.DeleteExtensionTiles(tile, itemPt.X, itemPt.Y);