Ejemplo n.º 1
0
 private void loadDeck(DeckComponent deck)
 {
     this.current_deck.Clear();
     if (deck != null)
     {
         Archetypes archetypes = Finder.FindOrThrow <Archetypes>();
         Directory.CreateDirectory("decks");
         foreach (KeyValuePair <DeckID, DeckComponent> keyValuePair in Finder.FindOrThrow <Decks>().get_All())
         {
             Pile pile2;
             if (keyValuePair.Key != null && keyValuePair.Value.get_Piles().TryGetValue(Constants.K(), out pile2))
             {
                 string to_write = "";
                 foreach (KeyValuePair <ArchetypeID, int> keyValuePair2 in pile2)
                 {
                     to_write = string.Concat(new object[]
                     {
                         to_write,
                         archetypes.get_All()[keyValuePair2.Key].GetOne <NameData>().get_Name(),
                         " ",
                         keyValuePair2.Value,
                         "\r\n"
                     });
                 }
                 File.WriteAllText(Path.Combine("decks", keyValuePair.Value.get_Name() + ".txt"), to_write);
             }
         }
         Pile pile3;
         if (deck.get_Piles().TryGetValue(Constants.K(), out pile3))
         {
             foreach (KeyValuePair <ArchetypeID, int> keyValuePair3 in pile3)
             {
                 ArchetypeComponent archetypeComponent;
                 if (this.local_collection_avatars.get_All().TryGetValue(keyValuePair3.Key, out archetypeComponent))
                 {
                     this.tryToMove(keyValuePair3.Key, keyValuePair3.Value);
                 }
                 else
                 {
                     Debug.LogError(Constants.Fx() + keyValuePair3.Key);
                 }
             }
         }
         foreach (global::H.L l in this.current_deck.get_Stacks())
         {
             l.GetOne <global::g.p>().MarkAsRead();
         }
         ArchetypeComponent avatar = deck.GetAvatar(this.local_collection_avatars);
         this.deck_avatars.SetAvatar(avatar);
     }
     if (deck != null)
     {
         this.deck_name.SetName(deck.GetOne <DeckNameData>().get_Name(), deck.GetOne <global::E.y>().get_HasAutoName());
     }
     this.deck_editor_saver.set_UnsavedChanges(false);
 }
Ejemplo n.º 2
0
        public uint Read(ref ArchetypeComponent data, IInBitStream bitstream)
        {
            var propertyMask = (uint)0;


            if (bitstream.ReadMask())
            {
                var coherenceField = bitstream.ReadIntegerRange(15, -9999);
                data.index    = coherenceField;
                propertyMask |= 0b00000000000000000000000000000001;
            }

            return(propertyMask);
        }
        private void DeserializeArchetypeComponent(EntityManager entityManager, Entity entity, bool componentOwnership, AbsoluteSimulationFrame simulationFrame, Coherence.Replication.Protocol.Definition.IInBitStream protocolStream, bool justCreated, IInBitStream bitStream)
        {
            // If we own the entity, don't overwrite with downstream data from server
            // TODO: Server should never send downstream to the simulating client
            if (componentOwnership)
            {
                // Read and discard data (the stream must always be read)
                var temp = new ArchetypeComponent();
                unityReaders.Read(ref temp, protocolStream);
                return;
            }


            // Overwrite components that don't use interpolation
            var componentData = entityManager.GetComponentData <ArchetypeComponent>(entity);

            unityReaders.Read(ref componentData, protocolStream);
            entityManager.SetComponentData(entity, componentData);
        }
Ejemplo n.º 4
0
 bool global::H.q.IsRemoveValid(ArchetypeComponent archetype, out LocalizedString failure)
 {
     return(this.get_Validator().IsRemoveValid(archetype, out failure));
 }
Ejemplo n.º 5
0
 bool global::H.q.CardMaxInDeck(ArchetypeComponent archetype)
 {
     return(this.get_Validator().CardMaxInDeck(archetype));
 }
 public void ArchetypeComponent(IOutBitStream bitstream, ArchetypeComponent data)
 {
     bitstream.WriteIntegerRange(data.index, 15, -9999);
 }
Ejemplo n.º 7
0
 public void ArchetypeComponent(IInBitStream bitstream, ref ArchetypeComponent data)
 {
     data.index = bitstream.ReadIntegerRange(15, -9999);
 }
Ejemplo n.º 8
0
        private void DeserializeArchetypeComponent(Coherence.Replication.Protocol.Definition.IInBitStream protocolStream)
        {
            var ignored = new ArchetypeComponent();

            unityReaders.Read(ref ignored, protocolStream);
        }