if(@val>0) { createnpc(123); }; or if(@val>0) { createnpc(123); } else { missioncomplete(); };
Inheritance: AbstractStoryCommand
Ejemplo n.º 1
0
        public override IStoryCommand Clone()
        {
            IfElseCommand retCmd = new IfElseCommand();

            retCmd.m_Conditions = new List <IStoryValue <int> >();
            for (int i = 0; i < m_Conditions.Count; ++i)
            {
                retCmd.m_Conditions.Add(m_Conditions[i].Clone());
            }
            for (int i = 0; i < m_LoadedIfCommands.Count; i++)
            {
                List <IStoryCommand> cmds = new List <IStoryCommand>();
                for (int j = 0; j < m_LoadedIfCommands[i].Count; ++j)
                {
                    cmds.Add(m_LoadedIfCommands[i][j].Clone());
                }
                retCmd.m_LoadedIfCommands.Add(cmds);
            }
            for (int i = 0; i < m_LoadedElseCommands.Count; i++)
            {
                retCmd.m_LoadedElseCommands.Add(m_LoadedElseCommands[i].Clone());
            }
            retCmd.IsCompositeCommand = true;
            return(retCmd);
        }
Ejemplo n.º 2
0
        protected override IStoryCommand CloneCommand()
        {
            IfElseCommand retCmd = new IfElseCommand();

            retCmd.m_LocalInfoIndex   = m_LocalInfoIndex;
            retCmd.m_LoadedConditions = new List <IStoryValue <int> >();
            for (int i = 0; i < m_LoadedConditions.Count; ++i)
            {
                retCmd.m_LoadedConditions.Add(m_LoadedConditions[i].Clone());
            }
            for (int i = 0; i < m_LoadedIfCommands.Count; i++)
            {
                List <IStoryCommand> cmds = new List <IStoryCommand>();
                for (int j = 0; j < m_LoadedIfCommands[i].Count; ++j)
                {
                    cmds.Add(m_LoadedIfCommands[i][j].Clone());
                }
                retCmd.m_LoadedIfCommands.Add(cmds);
            }
            for (int i = 0; i < m_LoadedElseCommands.Count; i++)
            {
                retCmd.m_LoadedElseCommands.Add(m_LoadedElseCommands[i].Clone());
            }
            return(retCmd);
        }
Ejemplo n.º 3
0
 public override IStoryCommand Clone()
 {
     IfElseCommand retCmd = new IfElseCommand();
     retCmd.m_Conditions = new List<IStoryValue<int>>();
     for (int i = 0; i < m_Conditions.Count; ++i) {
         retCmd.m_Conditions.Add(m_Conditions[i].Clone());
     }
     for (int i = 0; i < m_LoadedIfCommands.Count; i++) {
         List<IStoryCommand> cmds = new List<IStoryCommand>();
         for (int j = 0; j < m_LoadedIfCommands[i].Count; ++j) {
             cmds.Add(m_LoadedIfCommands[i][j].Clone());
         }
         retCmd.m_LoadedIfCommands.Add(cmds);
     }
     for (int i = 0; i < m_LoadedElseCommands.Count; i++) {
         retCmd.m_LoadedElseCommands.Add(m_LoadedElseCommands[i].Clone());
     }
     retCmd.IsCompositeCommand = true;
     return retCmd;
 }