Inheritance: System.Windows.Controls.Control
示例#1
0
文件: Level.cs 项目: ibdknox/swred
        public void SendPersonTo(Stall stall)
        {
            if (this.selection != null) {

                if (this.selection.CanUseStall(stall)) {

                    this.selection.GoToStall(stall);
                    this.Deselect(this.selection);

                    this.UpdateWaitingLine();
                }
            }
        }
示例#2
0
文件: Level.cs 项目: ibdknox/swred
 public IEnumerable<Stall> GetNeighbors(Stall stall)
 {
     int stallIndex = this.stalls.IndexOf(stall);
     if (stallIndex > 0)
         yield return this.stalls[stallIndex - 1];
     if (stallIndex < this.stalls.Count - 1)
         yield return this.stalls[stallIndex + 1];
 }
示例#3
0
文件: Level.cs 项目: ibdknox/swred
 public void ScoreStallChoice(Stall stall)
 {
     int neighbors = this.GetNeighborCount(stall);
     if (neighbors > 0)
     {
         this.AdjustScore(neighbors * (-15));
         stall.Alert(neighbors * (-15), "Pee foul!");
     }
 }
示例#4
0
文件: Level.cs 项目: ibdknox/swred
        public int GetNeighborCount(Stall stall)
        {
            int stallIndex = this.stalls.IndexOf(stall);
            int neighbors = 0;
            if (stallIndex > 0 && this.stalls[stallIndex - 1].Person != null)
                ++neighbors;
            if (stallIndex < this.stalls.Count - 1 && this.stalls[stallIndex + 1].Person != null)
                ++neighbors;

            return neighbors;
        }