Example #1
0
 public static void RemoveVote(EatLocation location)
 {
     if (_instance._votes.ContainsKey(location.Name))
     {
         --_instance._votes[location.Name];
     }
     else
     {
         Debug.LogError("No such location: " + location.Name);
     }
     UpdateVoteString();
 }
Example #2
0
 public static void ShowSuggestion(EatLocation location)
 {
     if (!_instance.gameObject.activeInHierarchy)
     {
         _instance._card.IsSuggestion = true;
         CardMgr.singleton.AddSuggestion(_instance._card);
         _instance.ResetCardPos();
         _instance._card.Setup(location);
         _instance.gameObject.SetActive(true);
     }
     else
     {
         QueueLoc.Enqueue(location);
     }
 }
Example #3
0
 public void Setup(EatLocation location)
 {
     Location      = location;
     _txtName.text = location.Name;
     _txtDesc.text = location.Description;
     if (location.Sprite != null)
     {
         _img.sprite = location.Sprite;
     }
     if (location.MamaSays.Count > 0)
     {
         var random = Random.Range(0, location.MamaSays.Count);
         _txtMama.text = location.MamaSays[random];
     }
     else
     {
         _txtMama.text = "...";
     }
 }
Example #4
0
    void RpcSendSuggestion(string s, string desc)
    {
        EatLocation location;

        if (!EatLocation.Presets.TryGetValue(s, out location))
        {
            location = new EatLocation(s, desc);
        }
        VoteTracker.AddVote(location);
        VotesWindow.singleton.RefreshVotes();

        foreach (var player in Players)
        {
            if (player != this)
            {
                ++player.remainingSuggestions;
            }
        }
        if (!isLocalPlayer)
        {
            ReceiveSuggestion.ShowSuggestion(location);
        }
    }
Example #5
0
 public static void AddVote(EatLocation location)
 {
     AddVote(location.Name);
 }
Example #6
0
 void Awake()
 {
     EatLocation.Init(_locations);
 }