コード例 #1
0
ファイル: Room.cs プロジェクト: mkhubbard/trizbort-abandoned
        public Room(Project project)
            : base(project)
        {
            Name     = "Cave";
            Size     = new Vector(3 * Settings.GridSize, 2 * Settings.GridSize);
            Position = new Vector(-Size.X / 2, -Size.Y / 2);

            // connections may connect to any of our "corners"
            PortList.Add(new CompassPort(CompassPoint.North, this));
            PortList.Add(new CompassPort(CompassPoint.NorthNorthEast, this));
            PortList.Add(new CompassPort(CompassPoint.NorthEast, this));
            PortList.Add(new CompassPort(CompassPoint.EastNorthEast, this));
            PortList.Add(new CompassPort(CompassPoint.East, this));
            PortList.Add(new CompassPort(CompassPoint.EastSouthEast, this));
            PortList.Add(new CompassPort(CompassPoint.SouthEast, this));
            PortList.Add(new CompassPort(CompassPoint.SouthSouthEast, this));
            PortList.Add(new CompassPort(CompassPoint.South, this));
            PortList.Add(new CompassPort(CompassPoint.SouthSouthWest, this));
            PortList.Add(new CompassPort(CompassPoint.SouthWest, this));
            PortList.Add(new CompassPort(CompassPoint.WestSouthWest, this));
            PortList.Add(new CompassPort(CompassPoint.West, this));
            PortList.Add(new CompassPort(CompassPoint.WestNorthWest, this));
            PortList.Add(new CompassPort(CompassPoint.NorthWest, this));
            PortList.Add(new CompassPort(CompassPoint.NorthNorthWest, this));
        }
コード例 #2
0
 /// <summary>
 /// Rescans and updates ports in combo box
 /// </summary>
 public void Rescan()
 {
     ports        = SerialPort.GetPortNames();
     PortSelected = null;
     PortList.Clear();
     foreach (string port in ports)
     {
         PortList.Add(port);
     }
 }
コード例 #3
0
 private void OnVertexAdded(object sender, ItemEventArgs <Vertex> e)
 {
     e.Item.Connection = this;
     e.Item.Changed   += OnVertexChanged;
     PortList.Add(new VertexPort(e.Item, this));
 }
コード例 #4
0
 protected override void GetPorts(PortList portList)
 {
     portList.Add(new OutputPort <Vector3>("Jump Pos", () => validJumpPos));
     base.GetPorts(portList);
 }
コード例 #5
0
 protected override void GetPorts(PortList portList)
 {
     portList.Add(positionPort);
     base.GetPorts(portList);
 }