コード例 #1
0
        public void SetStateOnDisplay(StateViewModel svm)
        {
            int i = States.IndexOf(svm);

            if (i >= 0)
            {
                DisplayedStateIndex = i;
            }
            else
            {
                DisplayedStateIndex = 0;
            }
        }
コード例 #2
0
        public CoBehaviourViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            CoBehaviour modelObject)
        {
            _modelObject = modelObject;

            _parentVm               = parentVm;
            _sceneProperties        = new ScenePropertiesViewModel(treeParent, parentVm, mainVm, ModelObject.SceneProperties);
            _steerableObjProperties = new SteerableObjectPropertiesViewModel(treeParent, parentVm, mainVm, ModelObject.SteerableObjProps);
            _breakableObjProperties = new BreakableObjectPropertiesViewModel(treeParent, parentVm, mainVm, ModelObject.BreakableObjProps);

            _defaultState = new StateViewModel(_sceneProperties, parentVm, mainVm, null, "default");
            _defaultStates.Add(_defaultState);
        }
コード例 #3
0
        public ScenePropertiesViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            SceneProperties modelObject,
            bool enabled = true) :
            base(treeParent, parentVm, mainVm, enabled)
        {
            ModelObject = modelObject;

            foreach (string s in ModelObject.States)
            {
                StateViewModel svm = new StateViewModel(this, parentVm, mainVm, this, s);
                States.Add(svm);
            }
        }
コード例 #4
0
 public bool IsOnDisplay(StateViewModel svm)
 {
     return(States.IndexOf(svm) == DisplayedStateIndex);
 }