public void Spawn(int serializer, int ghostId, uint snapshot, DataStreamReader reader,
                      ref DataStreamReader.Context ctx, NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_CubeSnapshotDataNewGhostIds.Add(ghostId);
            m_CubeSnapshotDataNewGhosts.Add(GhostReceiveSystem <NetCodeGhostDeserializerCollection> .InvokeSpawn <CubeSnapshotData>(snapshot, reader, ref ctx, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_PlayerSnapshotDataNewGhostIds.Add(ghostId);
            m_PlayerSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <PlayerSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_ArrowSnapshotDataNewGhostIds.Add(ghostId);
            m_ArrowSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <ArrowSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 2:
            m_AArcherSnapshotDataNewGhostIds.Add(ghostId);
            m_AArcherSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <AArcherSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 3:
            m_ACivilianSnapshotDataNewGhostIds.Add(ghostId);
            m_ACivilianSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <ACivilianSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 4:
            m_BArcherSnapshotDataNewGhostIds.Add(ghostId);
            m_BArcherSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <BArcherSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 5:
            m_BCivilianSnapshotDataNewGhostIds.Add(ghostId);
            m_BCivilianSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <BCivilianSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 6:
            m_A_BarracksSnapshotDataNewGhostIds.Add(ghostId);
            m_A_BarracksSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <A_BarracksSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 7:
            m_B_BarracksSnapshotDataNewGhostIds.Add(ghostId);
            m_B_BarracksSnapshotDataNewGhosts.Add(GhostReceiveSystem <MobileRTSGhostDeserializerCollection> .InvokeSpawn <B_BarracksSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
Exemplo n.º 3
0
    public void Spawn(int serializer, int ghostId, uint snapshot, DataStreamReader reader,
                      ref DataStreamReader.Context ctx, NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
            #region __GHOST_INVOKE_SPAWN__
        case __GHOST_SERIALIZER_INDEX__:
            m___GHOST_SNAPSHOT_TYPE__NewGhostIds.Add(ghostId);
            m___GHOST_SNAPSHOT_TYPE__NewGhosts.Add(GhostReceiveSystem <__GHOST_COLLECTION_PREFIX__GhostDeserializerCollection> .InvokeSpawn <__GHOST_SNAPSHOT_TYPE__>(snapshot, reader, ref ctx, compressionModel));
            break;

            #endregion
        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
Exemplo n.º 4
0
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_LagCubeSnapshotDataNewGhostIds.Add(ghostId);
            m_LagCubeSnapshotDataNewGhosts.Add(GhostReceiveSystem <LagCompensationGhostDeserializerCollection> .InvokeSpawn <LagCubeSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_LagPlayerSnapshotDataNewGhostIds.Add(ghostId);
            m_LagPlayerSnapshotDataNewGhosts.Add(GhostReceiveSystem <LagCompensationGhostDeserializerCollection> .InvokeSpawn <LagPlayerSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_SphereSnapshotDataNewGhostIds.Add(ghostId);
            m_SphereSnapshotDataNewGhosts.Add(GhostReceiveSystem <MarchingSquaresGhostDeserializerCollection> .InvokeSpawn <SphereSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_VoxelGridSnapshotDataNewGhostIds.Add(ghostId);
            m_VoxelGridSnapshotDataNewGhosts.Add(GhostReceiveSystem <MarchingSquaresGhostDeserializerCollection> .InvokeSpawn <VoxelGridSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
Exemplo n.º 6
0
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_SpawnerSnapshotDataNewGhostIds.Add(ghostId);
            m_SpawnerSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <SpawnerSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_CubeSnapshotDataNewGhostIds.Add(ghostId);
            m_CubeSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <CubeSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 2:
            m_ItemSpawnerSnapshotDataNewGhostIds.Add(ghostId);
            m_ItemSpawnerSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <ItemSpawnerSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 3:
            m_CharacterSnapshotDataNewGhostIds.Add(ghostId);
            m_CharacterSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <CharacterSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 4:
            m_ItemSnapshotDataNewGhostIds.Add(ghostId);
            m_ItemSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <ItemSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 5:
            m_NetSessionSnapshotDataNewGhostIds.Add(ghostId);
            m_NetSessionSnapshotDataNewGhosts.Add(GhostReceiveSystem <DOTSGhostDeserializerCollection> .InvokeSpawn <NetSessionSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_CubeSnapshotDataNewGhostIds.Add(ghostId);
            m_CubeSnapshotDataNewGhosts.Add(GhostReceiveSystem <dotsnetcodesampleGhostDeserializerCollection> .InvokeSpawn <CubeSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_ServerCubeSnapshotDataNewGhostIds.Add(ghostId);
            m_ServerCubeSnapshotDataNewGhosts.Add(GhostReceiveSystem <dotsnetcodesampleGhostDeserializerCollection> .InvokeSpawn <ServerCubeSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 2:
            m_ProjectileSnapshotDataNewGhostIds.Add(ghostId);
            m_ProjectileSnapshotDataNewGhosts.Add(GhostReceiveSystem <dotsnetcodesampleGhostDeserializerCollection> .InvokeSpawn <ProjectileSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
Exemplo n.º 8
0
    public void Spawn(int serializer, int ghostId, uint snapshot, ref DataStreamReader reader,
                      NetworkCompressionModel compressionModel)
    {
        switch (serializer)
        {
        case 0:
            m_PaddleTheSideSnapshotDataNewGhostIds.Add(ghostId);
            m_PaddleTheSideSnapshotDataNewGhosts.Add(GhostReceiveSystem <MultiplayerPongGhostDeserializerCollection> .InvokeSpawn <PaddleTheSideSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 1:
            m_PaddleOtherSideSnapshotDataNewGhostIds.Add(ghostId);
            m_PaddleOtherSideSnapshotDataNewGhosts.Add(GhostReceiveSystem <MultiplayerPongGhostDeserializerCollection> .InvokeSpawn <PaddleOtherSideSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        case 2:
            m_SphereSnapshotDataNewGhostIds.Add(ghostId);
            m_SphereSnapshotDataNewGhosts.Add(GhostReceiveSystem <MultiplayerPongGhostDeserializerCollection> .InvokeSpawn <SphereSnapshotData>(snapshot, ref reader, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
    public void Spawn(int serializer, int ghostId, uint snapshot, DataStreamReader reader,
                      ref DataStreamReader.Context ctx, NetworkCompressionModel compressionModel)
    {
        switch ((GhostSerializerCollection.SerializerType)serializer)
        {
        case GhostSerializerCollection.SerializerType.Ship:
            shipNewGhostIds.Add(ghostId);
            shipNewGhosts.Add(GhostReceiveSystem.InvokeSpawn <ShipSnapshotData>(snapshot, reader, ref ctx, compressionModel));
            break;

        case GhostSerializerCollection.SerializerType.Asteroid:
            asteroidNewGhostIds.Add(ghostId);
            asteroidNewGhosts.Add(GhostReceiveSystem.InvokeSpawn <AsteroidSnapshotData>(snapshot, reader, ref ctx, compressionModel));
            break;

        case GhostSerializerCollection.SerializerType.Bullet:
            bulletNewGhostIds.Add(ghostId);
            bulletNewGhosts.Add(GhostReceiveSystem.InvokeSpawn <BulletSnapshotData>(snapshot, reader, ref ctx, compressionModel));
            break;

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }