Esempio n. 1
0
        public CrossGate(Memo memo) : base(memo)
        {
            Actions = new Actions(memo);
            Cheater = new Cheater(memo);
            Player  = new Player(memo);
            Stuffs  = new StuffList(memo);


            Combat     = new Combat(this);
            AutoCure   = new AutoCure(this);
            Contacts   = new ContactList(memo);
            Pets       = new PetList(memo);
            Items      = new ItemList(this);
            AutoFood   = new AutoFood(this);
            AutoNurse  = new AutoNurse(this);
            PetCatch   = new PetCatch(this);
            Producer   = new Producer(this);
            AutoCombat = new AutoCombat(this);
            AutoWalk   = new AutoWalk(this);
            Script     = Script.GetNewTownInstance(this);
            Poster     = new Poster(this);
            AutoChange = new AutoChange(this);

            MoveScript          = new MoveScript(this);
            Cheater.YiDongJiaSu = true;
        }
Esempio n. 2
0
 T GetEntityByID <T>(Guid id) where T : IStoryEntityObject
 {
     if (typeof(IActor).IsAssignableFrom(typeof(T)))
     {
         var r = ActorList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     if (typeof(IEvent).IsAssignableFrom(typeof(T)))
     {
         var r = EventList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     if (typeof(IGroup).IsAssignableFrom(typeof(T)))
     {
         var r = GroupList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     if (typeof(IStuff).IsAssignableFrom(typeof(T)))
     {
         var r = StuffList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     if (typeof(ITask).IsAssignableFrom(typeof(T)))
     {
         var r = TaskList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     if (typeof(ILocation).IsAssignableFrom(typeof(T)))
     {
         var r = LocationList.FirstOrDefault(v => v.ObjectID == id);
         if (r == null)
         {
             return(default(T));
         }
         return((T)r);
     }
     return(default(T));
 }
Esempio n. 3
0
        public List <IStoryEntityObject> GetAllEntityList()
        {
            var el = new List <IStoryEntityObject>();

            ActorList.ForEach(v => el.Add(v));
            GroupList.ForEach(v => el.Add(v));
            EventList.ForEach(v => el.Add(v));
            LocationList.ForEach(v => el.Add(v));
            StuffList.ForEach(v => el.Add(v));
            TaskList.ForEach(v => el.Add(v));
            return(el);
        }
Esempio n. 4
0
        public List <string> GetAllParameterName()
        {
            List <string> l = new List <string>();

            AddParameterName(ActorList.Cast <IStoryEntityObject>().ToList(), l);
            AddParameterName(EventList.Cast <IStoryEntityObject>().ToList(), l);
            AddParameterName(GroupList.Cast <IStoryEntityObject>().ToList(), l);
            AddParameterName(TaskList.Cast <IStoryEntityObject>().ToList(), l);
            AddParameterName(StuffList.Cast <IStoryEntityObject>().ToList(), l);
            AddParameterName(RelationList.Cast <IStoryEntityObject>().ToList(), l);

            return(l);
        }
Esempio n. 5
0
        //List<IRole> _RoleList = new List<IRole>();
        //public List<IRole> RoleList { get { return _RoleList; } }

        public ICopySupportObject Clone()
        {
            var o = new Story()
            {
                Name = Name, Memo = Memo, BeginTime = BeginTime, EndTime = EndTime, Author = Author, StoryVersion = StoryVersion
            };

            //o.CurrentUniverse = CurrentUniverse.Clone() as IUniverse;
            ActorList.ForEach(v => o.ActorList.Add(v.Clone() as IActor));
            StuffList.ForEach(v => o.StuffList.Add(v.Clone() as IStuff));
            ExpressList.ForEach(v => o.ExpressList.Add(v.Clone() as IExpress));
            NoteList.ForEach(v => o.NoteList.Add(v.Clone() as INote));
            EventList.ForEach(v => o.EventList.Add(v.Clone() as IEvent));
            RelationList.ForEach(v => o.RelationList.Add(v.Clone() as IRelation));
            TaskList.ForEach(v => o.TaskList.Add(v.Clone() as ITask));
            GroupList.ForEach(v => o.GroupList.Add(v.Clone() as IGroup));
            StructureDiagramList.ForEach(v => o.StructureDiagramList.Add(v.Clone() as IStructureDiagram));

            return(o);
        }
Esempio n. 6
0
 public void RemoveEntity(IStoryEntityObject obj)
 {
     if (obj == null)
     {
         return;
     }
     if ((obj as IActor) != null)
     {
         ActorList.Remove(obj as IActor);
         return;
     }
     if ((obj as IEvent) != null)
     {
         EventList.Remove(obj as IEvent);
         return;
     }
     if ((obj as IStuff) != null)
     {
         StuffList.Remove(obj as IStuff);
         return;
     }
     if ((obj as IGroup) != null)
     {
         GroupList.Remove(obj as IGroup);
         return;
     }
     if ((obj as ITask) != null)
     {
         TaskList.Remove(obj as ITask);
         return;
     }
     if ((obj as ILocation) != null)
     {
         LocationList.Remove(obj as ILocation);
         return;
     }
 }
Esempio n. 7
0
                // Private methods ////////////////////////////////////////////

                protected override TaskStatus ExecuteStep (int s)
                {
                        bool cont = true;

                        // Main
                        switch (currentStep) {

                                case OpenerTaskStep.Init:
                                        objectsList = new List <ObjectInfo> ();
                                        xmlDocument = new XmlDocument ();
                                        xmlDocument.Load (fileName);
                                        currentStep = OpenerTaskStep.Header;
                                        break;

                                case OpenerTaskStep.Header:
                                        //ReadHeader ();
                                        currentStep = OpenerTaskStep.ProjectInfoRead;
                                        break;

                                case OpenerTaskStep.ProjectInfoRead:
                                        foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
                                                if (node.Name == "projectinfo")
                                                        ResolveProjectInfoNode (node);

                                        // FIXME: Fail if not found/not resolved
                                        currentStep = OpenerTaskStep.ObjectListRead;
                                        break;

                                case OpenerTaskStep.ObjectListRead:
                                        foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
                                                if (node.Name == "objectlist")
                                                        objectListContainer = (ObjectListContainer)
                                                                DataFactory.MakeDataElement  (node as XmlElement);

                                        if (objectListContainer == null)
                                                throw new Exception ("ObjectListContainer not found!");

                                        currentStep = OpenerTaskStep.ObjectListParse;
                                        break;

                                case OpenerTaskStep.ObjectListParse:
                                        bool flush = EnumerateSomeObjects ();
                                        if (flush)
                                                currentStep = OpenerTaskStep.ObjectListUnBoil;
                                        break;

                                case OpenerTaskStep.ObjectListUnBoil:
                                        bool done = UnBoilSomeObjects ();
                                        if (done)
                                                currentStep = OpenerTaskStep.FindRoots;
                                        break;


                                case OpenerTaskStep.FindRoots:
                                        projectTrackList = (TrackList) FindRoot ("tracklist");
                                        projectTagList = (TagList) FindRoot ("taglist");
                                        projectStuffList = (StuffList) FindRoot ("stufflist");
                                        projectClipList = (ClipList) FindRoot ("cliplist");
                                        projectMediaItemList = (MediaItemList) FindRoot ("mediaitemlist");
                                        projectPipeline = (Gdv.Pipeline) FindRoot ("pipeline");
                                        projectCommander = (Commander) FindRoot ("commander");
                                        projectFormat = (Gdv.ProjectFormat) FindRoot ("projectformat");

                                        currentStep = OpenerTaskStep.Finished;
                                        break;

                                case OpenerTaskStep.Finished:
                                        cont = false;
                                        break;

                                default:
                                        break;
                        }

                        // Post
                        if (cont)
                                return TaskStatus.Running;
                        else
                                return TaskStatus.Done;
                }
Esempio n. 8
0
        // Private methods ////////////////////////////////////////////

        protected override TaskStatus ExecuteStep(int s)
        {
            bool cont = true;

            // Main
            switch (currentStep)
            {
            case OpenerTaskStep.Init:
                objectsList = new List <ObjectInfo> ();
                xmlDocument = new XmlDocument();
                xmlDocument.Load(fileName);
                currentStep = OpenerTaskStep.Header;
                break;

            case OpenerTaskStep.Header:
                //ReadHeader ();
                currentStep = OpenerTaskStep.ProjectInfoRead;
                break;

            case OpenerTaskStep.ProjectInfoRead:
                foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
                {
                    if (node.Name == "projectinfo")
                    {
                        ResolveProjectInfoNode(node);
                    }
                }

                // FIXME: Fail if not found/not resolved
                currentStep = OpenerTaskStep.ObjectListRead;
                break;

            case OpenerTaskStep.ObjectListRead:
                foreach (XmlNode node in xmlDocument.DocumentElement.ChildNodes)
                {
                    if (node.Name == "objectlist")
                    {
                        objectListContainer = (ObjectListContainer)
                                              DataFactory.MakeDataElement(node as XmlElement);
                    }
                }

                if (objectListContainer == null)
                {
                    throw new Exception("ObjectListContainer not found!");
                }

                currentStep = OpenerTaskStep.ObjectListParse;
                break;

            case OpenerTaskStep.ObjectListParse:
                bool flush = EnumerateSomeObjects();
                if (flush)
                {
                    currentStep = OpenerTaskStep.ObjectListUnBoil;
                }
                break;

            case OpenerTaskStep.ObjectListUnBoil:
                bool done = UnBoilSomeObjects();
                if (done)
                {
                    currentStep = OpenerTaskStep.FindRoots;
                }
                break;


            case OpenerTaskStep.FindRoots:
                projectTrackList     = (TrackList)FindRoot("tracklist");
                projectTagList       = (TagList)FindRoot("taglist");
                projectStuffList     = (StuffList)FindRoot("stufflist");
                projectClipList      = (ClipList)FindRoot("cliplist");
                projectMediaItemList = (MediaItemList)FindRoot("mediaitemlist");
                projectPipeline      = (Gdv.Pipeline)FindRoot("pipeline");
                projectCommander     = (Commander)FindRoot("commander");
                projectFormat        = (Gdv.ProjectFormat)FindRoot("projectformat");

                currentStep = OpenerTaskStep.Finished;
                break;

            case OpenerTaskStep.Finished:
                cont = false;
                break;

            default:
                break;
            }

            // Post
            if (cont)
            {
                return(TaskStatus.Running);
            }
            else
            {
                return(TaskStatus.Done);
            }
        }