Beispiel #1
0
        /*
         * public override bool clicked(Farmer who)
         * {
         *  if(who.CurrentTool == null)
         *  {
         *      DataAccess DataAccess = DataAccess.GetDataAccess();
         *      if (DataAccess.IOPipeNames.Contains(this.Name))
         *      {
         *          List<Node> nodes = DataAccess.LocationNodes[Game1.currentLocation];
         *          Node node = nodes.Find(n => n.Position.Equals(this.TileLocation));
         *          if(node is IOPipeNode)
         *          {
         *              IOPipeNode pipe = (IOPipeNode)node;
         *              if (pipe != null)
         *              {
         *                  Printer.Info($"{Name} is {pipe.Signal}");
         *
         *              }
         *          }
         *      }
         *  }
         *  return false;
         * }
         */

        public void ChangeSignal()
        {
            DataAccess  DataAccess = DataAccess.GetDataAccess();
            List <Node> nodes      = DataAccess.LocationNodes[Game1.currentLocation];
            IOPipeNode  pipe       = (IOPipeNode)nodes.Find(n => n.Position.Equals(this.TileLocation));

            pipe.ChangeSignal();
            UpdateSignal(pipe.Signal);
        }