Exemplo n.º 1
0
 void SetMapInfoData(IMapDataView mapInfoView)
 {
     sceneName.text   = mapInfoView.name;
     coordinates.text = $"{mapInfoView.baseCoord.x},{mapInfoView.baseCoord.y}";
     creatorName.text = mapInfoView.creator;
     description.text = mapInfoView.description;
 }
Exemplo n.º 2
0
    public void SetMinimapData(Vector2Int baseCoord, IMapDataView targetView, Action <IMapDataView> onResolvedCallback, Action <IMapDataView> onRejectedCallback)
    {
        if (targetView.HasMinimapSceneInfo())
        {
            onResolvedCallback?.Invoke(targetView);
            return;
        }

        targetView.SetBaseCoord(baseCoord);

        var info = MinimapMetadata.GetMetadata().GetSceneInfo(baseCoord.x, baseCoord.y);

        if (info != null)
        {
            targetView.SetMinimapSceneInfo(info);
            onResolvedCallback?.Invoke(targetView);
        }
        else
        {
            PendingData pending = null;
            if (!pendingSceneData.TryGetValue(baseCoord, out pending))
            {
                pending = new PendingData();
                pendingSceneData.Add(baseCoord, pending);
            }

            pending.AddPending(targetView, onResolvedCallback, onRejectedCallback);
        }
    }
Exemplo n.º 3
0
 void SetMapInfoData(IMapDataView mapInfoView)
 {
     MinimapMetadata.MinimapSceneInfo mapInfo = mapInfoView.GetMinimapSceneInfo();
     sceneName.text   = mapInfo.name;
     coordinates.text = $"{mapInfoView.GetBaseCoord().x},{mapInfoView.GetBaseCoord().y}";
     creatorName.text = mapInfo.owner;
     description.text = mapInfo.description;
 }
Exemplo n.º 4
0
 public void AddPending(IMapDataView view, Action <IMapDataView> onResolveCallback, Action <IMapDataView> onRejectCallback)
 {
     infoToResolve.Add(new MapDataToResolve()
     {
         view = view,
         onResolveCallback = onResolveCallback,
         onRejectCallback  = onRejectCallback
     });
 }
 public FriendsHandler(IMapDataView mapInfoHandler)
 {
     this.mapInfoHandler = mapInfoHandler;
 }