Exemple #1
0
    //To create action cell u need to create BAction,
    //then assign it to BSObject
    //and then assign BSObject to cell
    //and return list with events u created
    //examples are here
    public List <BattleCell> AddTargets()
    {
        //Creating BAction
        BAction easyTarget = actionFactory.CreateAction()
                             .AddSkillTest(
            skill: new Skills(str: 5),
            pass: "******",
            fail: "Soldier was too weak to save man");

        BAction hardTarget = actionFactory.CreateAction()
                             .AddItemTest(
            item: new Item(name: "Shovel", count: 1),
            pass: "******",
            fail: "Soldier has no shovel to help man")
                             .AddSkillTest(
            skill: new Skills(med: 1, str: 2),
            pass: "******",
            fail: "Soldier left one-leged man to die");

        BAction insaneTarget = actionFactory.CreateAction()
                               .AddItemTest(
            item: new Item("Knife", 1),
            pass: "******",
            fail: "Soldier has no items to help man")
                               .AddSkillTest(
            skill: new Skills(med: 5, str: 0),
            pass: "******",
            fail: "Soldier didn retrieves a bullet and man died with pain")
                               .AddAnotherAction((Character ch) => { Debug.Log("Sad soldier goes home"); });

        //creating BSObjects with events
        EventObject event1 = actionFactory.CreateEvent(easyTarget);
        EventObject event2 = actionFactory.CreateEvent(hardTarget);
        EventObject event3 = actionFactory.CreateEvent(insaneTarget);

        //creating EventCells with BSObjects
        return(new List <BattleCell>()
        {
            cellFactory.CreateCell(s.action, event1),
            cellFactory.CreateCell(s.action, event2),
            cellFactory.CreateCell(s.action, event3)
        });
    }