public RoomState Copy() { var rs = new RoomState(PlayerPosition, Entities.ConvertAll(e => e.Copy())); rs.MoveCount = MoveCount; return(rs); }
public Room(int width, int height, IntVec[] switches, Teleporter[] teleporters, RoomState initialState) { Width = width; Height = height; field = new FieldObject[Width, Height]; Switches = switches; Teleporters = teleporters; this.initialState = initialState.Copy(); history = new Stack <RoomState>(); CurrentState = initialState.Copy(); CurrentState.MoveCount = 0; }