public int GetSideBeamExits(int sideEntered) { if (MyOccupant == null) { return(Sides.GetOpposite(sideEntered)); } // No BoardOccupant? Pass straight through me; simply return the other side. return(MyOccupant.SideBeamExits(sideEntered)); }
public bool CanBeamExit(int sideExiting) { if (IsWall(sideExiting)) { return(false); } // Wall in the way? Return false. if (MyOccupant == null) { return(true); } // Nobody's on me! Yes, beams are free to fly! return(MyOccupant.CanBeamExit(sideExiting)); // I can accept a beam if there's nothing on me, OR the thing on me doesn't block beams from this side! }
public void SetMyOccupant(BoardOccupant _bo) { if (MyOccupant != null) { throw new UnityException("Oops! Trying to set a Space's Occupant, but that Space already has an Occupant! original: " + MyOccupant.GetType() + ", new: " + _bo.GetType().ToString() + ". " + Col + ", " + Row); } MyOccupant = _bo; }