public bool AddAtomOrBond_AllowIllegal(DraggedAtomOrBondInfo atomOrBond, int x, int y) { Vector2i position = new Vector2i(x, y); if (atomOrBond.mode == AtomOrBondDragMode.AtomDrag) { ReplaceAtomWithBondCountEnforcement(position, atomOrBond.atom); return(true); } if (atomOrBond.mode == AtomOrBondDragMode.BondOverride) { // This is the only line we've changed. In this version, we only care about // the participating atoms being present, and deliberately ignore the bond limit. return(SetBondCountWithoutMaxBondsCheck(new PotentialBond(position, atomOrBond.bondDirection), atomOrBond.bondCount)); } if (atomOrBond.mode == AtomOrBondDragMode.BondRemoval) { return(RemoveBond(new PotentialBond(position, atomOrBond.bondDirection))); } return(false); }
public bool AddAtomOrBond(DraggedAtomOrBondInfo atomOrBond, int x, int y) { Vector2i position = new Vector2i(x, y); if (atomOrBond.mode == AtomOrBondDragMode.AtomDrag) { ReplaceAtomWithBondCountEnforcement(position, atomOrBond.atom); return(true); } if (atomOrBond.mode == AtomOrBondDragMode.BondOverride) { // This is the only line we've changed. This method can only be called from the molecule editor UI, // and since the unknown element is only shown for output note editors, we can safely define special // rules for it without breaking gameplay. If someone already hacked an unknown element into a custom // puzzle input or output, they can also hack invalid bonds, so we aren't opening new exploits, either. return(SetBondCountWithSpecialUnknownHandling(new PotentialBond(position, atomOrBond.bondDirection), atomOrBond.bondCount)); } if (atomOrBond.mode == AtomOrBondDragMode.BondRemoval) { return(RemoveBond(new PotentialBond(position, atomOrBond.bondDirection))); } return(false); }