File size: 942 Bytes
ce81a16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Quantum
{
  unsafe public class ConfigAssetsHelper
  {
    public static TurnConfig GetTurnConfig(Frame f, TurnType type)
    {
      var configAssets = f.FindAsset<ConfigAssets>(f.RuntimeConfig.ConfigAssets.Id);
      TurnConfig config = null;
      switch (type)
      {
        case TurnType.Countdown:
          config = f.FindAsset<TurnConfig>(configAssets.CountdownTurnConfig.Id);
          break;
        case TurnType.Play:
          config = f.FindAsset<TurnConfig>(configAssets.PlayTurnConfig.Id);
          break;
        default:
          break;
      }
      return config;
    }

    public static GameConfig GetGameConfig(Frame f) {
      var configAssets = f.FindAsset<ConfigAssets>(f.RuntimeConfig.ConfigAssets.Id);
      return f.FindAsset<GameConfig>(configAssets.GameConfig.Id);
    }
  }
}