// Pop a unit list update; return null if there isn't one.
 public RemoteFortressReader.UnitList PopUnitListUpdate()
 {
     lock (unitListLock)
     {
         RemoteFortressReader.UnitList result = _netUnitList;
         _netViewInfo = null;
         return(result);
     }
 }
 // Pop a view update; return null if there isn't one.
 public RemoteFortressReader.ViewInfo PopViewInfoUpdate()
 {
     lock (viewInfoLock)
     {
         RemoteFortressReader.ViewInfo result = _netViewInfo;
         _netViewInfo = null;
         return(result);
     }
 }
示例#3
0
    void UpdateView()
    {
        RemoteFortressReader.ViewInfo newView = DFConnection.Instance.PopViewInfoUpdate();
        if (newView == null)
        {
            return;
        }
        //Debug.Log("Got view");
        view = newView;

        posXTile = (view.view_pos_x + (view.view_size_x / 2));
        posYTile = (view.view_pos_y + (view.view_size_y / 2));
        posZ     = view.view_pos_z + 1;
    }
 // Pop a view update; return null if there isn't one.
 public RemoteFortressReader.ViewInfo PopViewInfoUpdate()
 {
     lock (viewInfoLock)
     {
         RemoteFortressReader.ViewInfo result = _netViewInfo;
         _netViewInfo = null;
         return result;
     }
 }
 // Pop a unit list update; return null if there isn't one.
 public RemoteFortressReader.UnitList PopUnitListUpdate()
 {
     lock (unitListLock)
     {
         RemoteFortressReader.UnitList result = _netUnitList;
         _netViewInfo = null;
         return result;
     }
 }
示例#6
0
    void UpdateView()
    {
        RemoteFortressReader.ViewInfo newView = DFConnection.Instance.PopViewInfoUpdate();
        if (newView == null) return;
        //Debug.Log("Got view");
        view = newView;

        posXTile = (view.view_pos_x + (view.view_size_x / 2));
        posYTile = (view.view_pos_y + (view.view_size_y / 2));
        posZ = view.view_pos_z + 1;
    }
示例#7
0
    void UpdateView()
    {
        RemoteFortressReader.ViewInfo newView = DFConnection.Instance.PopViewInfoUpdate();
        if (newView == null) return;
        //Debug.Log("Got view");
        view = newView;

        if (view.follow_unit_id != -1 && lastUnitList != null)
        {
            foreach (var unit in lastUnitList.creature_list)
            {
                if (unit.id == view.follow_unit_id)
                {
                    posXTile = unit.pos_x;
                    posYTile = unit.pos_y;
                    posZ = unit.pos_z + 1;
                    return;
                }
            }
        }

        posXTile = (view.view_pos_x + (view.view_size_x / 2));
        posYTile = (view.view_pos_y + (view.view_size_y / 2));
        posZ = view.view_pos_z + 1;
    }