/// <summary> /// Constructs a form that contains a pbt inspector. /// </summary> /// <param name="pbt">The root of the pbt to inspect.</param> public PBTInspectorForm(PBT.RootTask <DataType> pbt) { Text = "PBT Inspector"; Size = new Size(1024, 600); Inspector = new PBTInspectorControl <DataType, ImpulseType>(pbt); Inspector.Dock = DockStyle.Fill; Controls.Add(Inspector); }
/// <summary> /// Initializes the actor and loads its AI pbt. /// </summary> /// <param name="simulation">The simulation that the constructed actor is part of.</param> /// <param name="position">The initial position.</param> public Actor(Simulation simulation, Point position) { initialPosition = position; Simulation = simulation; X = position.X; Y = position.Y; Angle = (float)(Simulation.Random.NextDouble() * 2.0 * Math.PI); Size = 4; BrushColor = Color.FromArgb(position.X % 255, (128 + position.X) % 255, Math.Max(0, 255 - position.Y)); Brush = new SolidBrush(BrushColor); Pen = Pens.LightYellow; AI = PBT.Parser.Load <Actor, ActorImpulses>(".", "AI", this, PBTConfig.Usings, PBTConfig.Logger); }
/// <summary> /// Constructs the pbt inspector. /// </summary> /// <param name="pbt">The root of the pbt to inspect.</param> public PBTInspectorControl(PBT.RootTask <DataType> pbt) : base(new GraphicsMode(new ColorFormat(8, 8, 8, 8), 24, 0, 4)) { this.Root = pbt; this.Load += OnLoad; }