public PingPongForm(Kugelmatik kugelmatik) { InitializeComponent(); this.Kugelmatik = kugelmatik; this.Game = new Game(kugelmatik); }
public Game(Kugelmatik kugelmatik) { if (kugelmatik == null) throw new ArgumentNullException("kugelmatik"); this.Kugelmatik = kugelmatik; this.World = new World(this); }
public StepByStepHomeForm(Kugelmatik kugelmatik) { InitializeComponent(); this.Kugelmatik = kugelmatik; UpdateStatus(); Kugelmatik.GetStepperByPosition(currentX, currentY).SendHome(); }
public static void ApplyFunction(Kugelmatik kugelmatik, TimeSpan time, IChoreographyFunction function) { for (int x = 0; x < kugelmatik.StepperCountX; x++) for (int y = 0; y < kugelmatik.StepperCountY; y++) { Stepper stepper = kugelmatik.GetStepperByPosition(x, y); stepper.Set(function.GetHeight(stepper.Cluster, time, x, y)); } }
public ConfigForm(MainForm mainForm, Kugelmatik kugelmatik) { this.mainForm = mainForm; this.kugelmatik = kugelmatik; InitializeComponent(); propertyGrid.SelectedObject = kugelmatik.Config; clusterPropertyGrid.SelectedObject = kugelmatik.ClusterConfig; }
public ChoreographyManager(Kugelmatik kugelmatik, int targetFPS, Choreography choreography) { if (kugelmatik == null) throw new ArgumentNullException("kugelmatik"); if (targetFPS <= 0) throw new ArgumentOutOfRangeException("targetFPS"); if (choreography == null) throw new ArgumentNullException("choreography"); this.Kugelmatik = kugelmatik; this.TargetFPS = targetFPS; this.Choreography = choreography; }
public Cluster(Kugelmatik kugelmatik, int x, int y, IPAddress address) { if (kugelmatik == null) throw new ArgumentNullException(nameof(kugelmatik)); if (x < 0 || x >= 16) throw new ArgumentOutOfRangeException(nameof(x)); if (y < 0 || y >= 16) throw new ArgumentOutOfRangeException(nameof(y)); if (address == null) throw new ArgumentNullException(nameof(address)); this.Kugelmatik = kugelmatik; this.X = x; this.Y = y; this.Address = address; steppers = new Stepper[Width * Height]; for (byte i = 0; i < Width; i++) for (byte j = 0; j < Height; j++) steppers[j * Width + i] = new Stepper(this, i, j); if (address == null) return; socket = new UdpClient(); socket.Connect(address, kugelmatik.Config.ProtocolPort); packetWriter = new BinaryWriter(packetBuffer); socket.BeginReceive(ReceivePacket, null); // Ping senden SendPing(); OnConnected += (sender, args) => { packetsToAcknowledge.Clear(); packetSendTime.Clear(); // ResetRevision Paket senden damit die Revision wieder zurück gesetzt wird SendPacket(new PacketResetRevision(), true); // Daten abfragen SendGetData(); SendInfo(); }; }
public HeightViewForm(Kugelmatik kugelmatik) { if (kugelmatik == null) throw new ArgumentNullException("kugelmatik"); this.Kugelmatik = kugelmatik; InitializeComponent(); // UI initialisieren minHeight.Minimum = 0; minHeight.Maximum = Kugelmatik.ClusterConfig.MaxSteps; maxHeight.Minimum = 0; maxHeight.Maximum = Kugelmatik.ClusterConfig.MaxSteps; maxHeight.Value = maxHeight.Maximum; }
public abstract void Tick(Kugelmatik kugelmatik, TimeSpan time);
public override void Tick(Kugelmatik kugelmatik, TimeSpan time) { ApplyFunction(kugelmatik, time, Function); }
public ChoreographyManager(Kugelmatik kugelmatik, int targetFPS, IChoreographyFunction choreography) : this(kugelmatik, targetFPS, new ChoreographyDirect(choreography)) { }