Exemplo n.º 1
0
        //figure out if future speed limit is lower than the current speed limit
        private void considerSpeedLimit()
        {
            BlockTracker bs = new BlockTracker(prevToNext, currentBlock.blockNum, lineID);

            futureSpeedLimit   = bs.getSpeedLimit();
            futureSpeedLimitms = futureSpeedLimit / 3.6;
        }
Exemplo n.º 2
0
        public static void OnAdd(Vector3Int position, ushort type, Players.Player player)
        {
            ushort num;

            if (World.TryGetTypeAt(position.Add(0, -1, 0), out num) && ItemTypes.GetType(num).IsFertile)
            {
                BlockTracker.Add(new Herbs(position));
            }
        }
Exemplo n.º 3
0
 //calculate minumum stopping distance for the authority that the train has left
 private void considerAuthority()
 {
     if (authority <= 3 && authorityChanged)
     {
         BlockTracker bs = new BlockTracker(prevToNext, currentBlock.blockNum, lineID);
         //if (blockTracker.getOnSwtich()) bs.configureDirection();
         distanceToAuthority = bs.getDistance(authority);
         authorityChanged    = false;
     }
     if (distanceToAuthority > 0)
     {
         minStopDistanceAuthority = (currSpeedms * currSpeedms) / (2 * serviceBreak);
     }
 }
Exemplo n.º 4
0
        public static void OnChange(Vector3Int position, ushort typeOld, ushort typeNew, Players.Player player)
        {
            Herbs herb = BlockTracker.Get <Herbs>(position);

            if (herb != null)
            {
                if (typeNew == Jobs.HerbalistRegister.HerbStage1.ItemIndex)
                {
                    herb.type = HerbType.Stage1;
                }
                else
                {
                    herb.type = HerbType.Invalid;
                }
            }
        }
Exemplo n.º 5
0
 public static void Load(JSONNode array)
 {
     if (array == null)
     {
         return;
     }
     foreach (JSONNode current in array.LoopArray())
     {
         try
         {
             BlockTracker.Add(new Herbs((Vector3Int)current["location"], current["growth"].GetAs <float>()));
         }
         catch (Exception exc)
         {
             Log.WriteException("Exception loading a herb block;", exc);
         }
     }
 }
Exemplo n.º 6
0
 //sets up the internal track in the block tracker object
 private void setTrack(string input)
 {
     blockTracker = new BlockTracker(input, lineID);
     currentBlock = blockTracker.getCurrentBlock();
     distanceLeft = currentBlock.length;
 }
Exemplo n.º 7
0
 private static void Load()
 {
     _areaJobTracker = new BlockTracker <HerbalistJob>(JOB_NAME);
 }
Exemplo n.º 8
0
 public void Load()
 {
     tracker = new BlockTracker <T>(blockName);
 }
Exemplo n.º 9
0
 public BlockJobManager(string blockName)
 {
     this.blockName = blockName;
     tracker        = new BlockTracker(blockName);
 }
Exemplo n.º 10
0
 public static void OnRemove(Vector3Int position, ushort type, Players.Player player)
 {
     BlockTracker.Remove(position);
 }