Пример #1
0
    private void GetShellParameters(ZACommons commons)
    {
        // Some defaults
        ShellSpeed     = 100.0;
        ShellFireDelay = ShellOffset = 0.0;

        var group = commons.GetBlockGroupWithName(FC_FIRE_GROUP);

        if (group != null)
        {
            foreach (var block in group.Blocks)
            {
                if (block is IMyProgrammableBlock)
                {
                    var shellCustomData = new ZACustomData();
                    shellCustomData.Parse(block);
                    ShellSpeed     = shellCustomData.GetDouble("speed");
                    ShellFireDelay = shellCustomData.GetDouble("delay");
                    ShellOffset    = shellCustomData.GetDouble("offset");
                    // Only bother with the 1st one for now
                    return;
                }
            }
        }
    }
Пример #2
0
 public void Init(ZACommons commons, EventDriver eventDriver, ZACustomData customData,
                  Action <ZACommons, EventDriver> postLaunch)
 {
     PostLaunch   = postLaunch;
     ReleaseDelay = customData.GetDouble("releaseDelay");
     eventDriver.Schedule(0, Prime);
 }