コード例 #1
0
        public ScreenConstructionParameters DeepCopy()
        {
            ScreenConstructionParameters copy = new ScreenConstructionParameters(
                this.Location,
                this.Label,
                this.FractalCreator);
            copy.PostProcessor = this.PostProcessor;
            copy.ObjectPopulator = this.ObjectPopulator;

            foreach (KeyValuePair<Direction, Connection> kvp in this.Connections)
            {
                copy.Connections[kvp.Key] = kvp.Value;
            }

            return copy;
        }
コード例 #2
0
        public void AddScreen(ScreenConstructionParameters scp, string missionNodeID)
        {
            Point location = scp.Location;
            if (m_screenParameters.ContainsKey(location))
            {
                throw new InvalidOperationException("SpaceImpl already has that screen");
            }
            m_screenParameters.Add(location, scp);
            m_qualifiers.Add(location, new HashSet<String>());
            m_qualifiers[location].Add(missionNodeID);

            m_hashCode ^= getAreaHashCode(location);

            Point north = DirectionUtils.Move(location, Direction.Up);
            Point south = DirectionUtils.Move(location, Direction.Down);
            Point west = DirectionUtils.Move(location, Direction.Left);
            Point east = DirectionUtils.Move(location, Direction.Right);

            CoordPair fromNorth = new CoordPair(north, location);
            CoordPair fromSouth = new CoordPair(south, location);
            CoordPair fromWest = new CoordPair(west, location);
            CoordPair fromEast = new CoordPair(east, location);

            // checks for non-wall connections into this area.  those need to
            // be dealt with, preferably by: seeing if the old connection would cause a short
            // circuit, if so delete it, otherwise add it to this one.
            CleanupExistingConnection(fromNorth);
            CleanupExistingConnection(fromSouth);
            CleanupExistingConnection(fromWest);
            CleanupExistingConnection(fromEast);

            // TODO - figure out whether to add Wall connections adjacent to screen or not
            //throw new NotImplementedException();
        }