public void RemoveHypeOnEvent(Hype hype) { if (hype == null || !this.context.Hypes.Where(h => h == hype).Any()) { throw new ArgumentNullException(nameof(hype)); } context.Hypes.Remove(hype); }
public void AddHypeOnEvent(Hype hype) { if (hype == null) { throw new ArgumentNullException(nameof(hype)); } context.Hypes.Add(hype); }
void INetworkObserver.OnHypeInstanceFound(Instance instance) { Debug.WriteLine(String.Format("Hype found instance: {0}", instance.GetStringIdentifier())); if (ShouldResolveInstance(instance)) { Hype.Resolve(instance); } }
public override void Effect() { hypeCards[0] = new Hype(); //add two hype cards hypeCards[1] = new Hype(); Encounter.playerDiscard.Add(hypeCards[0]); Encounter.playerDiscard.Add(hypeCards[1]); Encounter.BeginningOfTurn.whatHappensAtBeginningOfTurn = RemoveTwoHype; //set to destroy cards after opponent's turn }
public void RequestHypeToStart() { // Add this as an Hype observer Hype.AddStateObserver(this); Hype.AddNetworkObserver(this); Hype.AddMessageObserver(this); // Generate an app identifier in the HypeLabs dashboard (https://hypelabs.io/apps/), // by creating a new app. Copy the given identifier here. Hype.SetAppIdentifier("{{app_identifier}}"); Hype.Start(); }
private Message SendMessage(String text, Instance instance) { // When sending content there must be some sort of protocol that both parties // understand. In this case, we simply send the text encoded in UTF-8. The data // must be decoded when received, using the same encoding. byte[] data = Encoding.UTF8.GetBytes(text); // Sends the data and returns the message that has been generated for it. Messages have // identifiers that are useful for keeping track of the message's deliverability state. // In order to track message delivery set the last parameter to true. Notice that this // is not recommend, as it incurs extra overhead on the network. Use this feature only // if progress tracking is really necessary. return(Hype.Send(data.AsBuffer(), instance, true)); }
public void Give_HypeSquad(string _HypeSquad, string _id) { string tokensu = token.Text; ClientInfos.GetInfos(tokensu); string nick = ClientInfos._Name; if (nick == null) { notifier.ShowError("Invalid Token"); } else { Hype.GiveHypeSquad(tokensu, _id); notifier.ShowSuccess("Success, Given " + _HypeSquad + " To " + nick); } }
void IStateObserver.OnHypeStateChange() { Debug.WriteLine(String.Format("Hype changed state to [{0}] (Idle=0, Starting=1, Running=2, Stopping=3)", (int)Hype.GetState())); }
public void RequestHypeToStop() { Hype.Stop(); }