private CALayer MakeCompositionLayer() { QCCompositionRepository repo = QCCompositionRepository.SharedCompositionRepository; QCComposition composition = repo.GetComposition("/moving shapes"); QCCompositionLayer compLayer = QCCompositionLayer.Create(composition); //CGColor cgColor = new CGColor(0.25f, 0.675f, 0.1f, 1.0f); NSColor nsColor = NSColor.FromCalibratedRgba(0.25f, 0.675f, 0.1f, 1.0f); string path = String.Format("patch.{0}.value", QCComposition.InputPrimaryColorKey); compLayer.SetValueForKeyPath(nsColor, (NSString)path); path = String.Format("patch.{0}.value", QCComposition.InputPaceKey); compLayer.SetValueForKeyPath(NSNumber.FromFloat(5.0f), (NSString)path); return(compLayer); }
public static QuestCondition BuildCondition(int step, string conditions) { QCComposition qcAnd = new QCComposition(QCComposition.Mode.And); if( conditions != null && conditions.Length > 0 ) { string [] codelist = conditions.Split(','); foreach(string code in codelist) { string [] kv = code.Split( ':'); string key = kv[0].Trim(); string val = string.Empty; if( kv.Length > 1 ) { val = kv[1].Trim(); } QuestCondition qc = null; if( key == "stepover" ) { qc = new QCStepTest(QCStepTest.Mode.Over, step); } else if( key == "stepunder" ) { qc = new QCStepTest(QCStepTest.Mode.Under, step); } else if( key == "stepin" ) { qc = new QCStepTest(QCStepTest.Mode.Equal, step); } else if( key == "beatall" ) { qc = new QCBeatEnemy(QCBeatEnemy.Mode.All, System.Int32.Parse (val), 0 ); } else if( key == "beatover" ) { string [] ekv = code.Split( '+'); string eid = ekv[0].Trim(); string en = ekv[1].Trim(); qc = new QCBeatEnemy(QCBeatEnemy.Mode.More, System.Int32.Parse (eid), System.Int32.Parse (en) ); } else if( key == "beatunder" ) { string [] ekv = code.Split( '+'); string eid = ekv[0].Trim(); string en = ekv[1].Trim(); qc = new QCBeatEnemy(QCBeatEnemy.Mode.Less, System.Int32.Parse (eid), System.Int32.Parse (en) ); } else if( key == "item" ) { qc = new QCHasItem(QCHasItem.Mode.HasItem, System.Int32.Parse (val)); } else if( key == "notitem" ) { qc = new QCHasItem(QCHasItem.Mode.DoesntHaveItem, System.Int32.Parse (val)); } else if( key == "levelover" ) { qc = new QCLevelTest(QCLevelTest.Mode.Over, System.Int32.Parse (val)); } else if( key == "levelunder" ) { qc = new QCLevelTest(QCLevelTest.Mode.Under, System.Int32.Parse (val)); } else if( key == "event" ) { qc = new QCEventTest(QCEventTest.Mode.Completed, System.Int32.Parse (val)); } else if( key == "notevent" ) { qc = new QCEventTest(QCEventTest.Mode.NotCompleted, System.Int32.Parse (val)); } if(qc != null) { qcAnd.Add (qc); } } } return qcAnd; }