private FoundGrid getOrCreateEntry(IMyCubeGrid grid) { FoundGrid entry = null; grids.TryGetValue(grid.EntityId, out entry); if (entry == null) { entry = new FoundGrid(grid); grids.Add(grid.EntityId, entry); MyAPIGateway.Utilities.ShowNotification("Found a new grid: " + entry.ToString()); } return(entry); }
private void handleGrid(IMyCubeGrid grid) { FoundGrid entry = getOrCreateEntry(grid); entry.updateData(); }