static void TestAll(string[] args) { // data DataStructures.RunInstanceNull(args); SparseVector.RunInstanceNull(args); SparseMatrix.RunInstanceNull(args); Stateful.RunInstanceNull(args); Cloning.RunInstanceNull(args); Serialization.RunInstanceNull(args); // model Bow.RunInstanceNull(args); BinarySvm.RunInstanceNull(args); // clustering KMeans.RunInstanceNull(args); // validation NFold.RunInstanceNull(args); NFoldClass.RunInstanceNull(args); // other Searching.RunInstanceNull(args); TextProcessing.RunInstanceNull(args); }
private void Awake() { gunSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); integrity = GetComponent <Integrity>(); }
private void Awake() { stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); integrity = GetComponent <Integrity>(); spriteHandler = GetComponentInChildren <SpriteHandler>(); }
/// <summary> /// Adds all visible GameObjects in the <see cref="Character"/>'s vision to the approriate entity list. /// </summary> /// <param name="radius">The radius of the vision the <see cref="Character"/> has.</param> /// <returns>A <see cref="List{GameObject}"/> of all visible <see cref="GameObject"/>s.</returns> public void AddAllVisibleObjects(Character character) { Vector3 eye = agentPosition + character.relativeEyePosition; //Translates player position to player view. Collider[] hitColliders = Physics.OverlapSphere(eye, Character.viewDistance); // @Todo, see if we can use layer mask to strip out walls/floors foreach (Collider hitCollider in hitColliders) { GameObject o = Utils.GetFirstObjectWithTag(hitCollider.gameObject); if (ignored.Contains(o.tag)) { continue; // Object needs to be interesting } if (!IsObjectVisibleToPlayer(o, eye)) { continue; // Object can't be blocked } Stateful s = null; if (o.transform.parent.TryGetComponent(out s) || o.transform.TryGetComponent(out s)) // @Todo, standardize objects to have the script on themselves OR the parent { entities.Add(new InteractiveEntity(o, s)); } else if (o.tag == "Dynamic") { entities.Add(new DynamicEntity(o)); } else { entities.Add(new Entity(o)); } } }
public Vector3 extents; // Half box size public InteractiveEntity(GameObject context, Stateful s) : base(context) { this.isActive = s.isActive; this.connectedObjects = s.connectedObjects; this.extents = s.interactiveBounds.extents; this.center = s.interactiveBounds.center; this.type = EntityType.Interactive; }
private void Awake() { circuitBoardSlot = GetComponent<ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent<Stateful>(); objectBehaviour = GetComponent<ObjectBehaviour>(); if (!CustomNetworkManager.IsServer) return; integrity = GetComponent<Integrity>(); integrity.OnWillDestroyServer.AddListener(WhenDestroyed); }
public void AddStateful(Stateful statefulObj) { bool noDouble = true; foreach (Stateful st in statefulObjectsOnscene) { if (st == statefulObj) { noDouble = false; break; } } if (noDouble) { statefulObjectsOnscene.Add(statefulObj); } }
private void Awake() { airlockElectronicsSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); overlayFillHandler = overlayFill.GetComponent <SpriteHandler>(); overlayHackingHandler = overlayHacking.GetComponent <SpriteHandler>(); if (!CustomNetworkManager.IsServer) { return; } integrity = GetComponent <Integrity>(); integrity.OnWillDestroyServer.AddListener(WhenDestroyed); }
private void Awake() { circuitBoardSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); SetSprite(); if (!isServer) { return; } if (CurrentState != partsAddedState) { stateful.ServerChangeState(initialState); } }
private void Awake() { powerControlSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); powerCellSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(1); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); if (!CustomNetworkManager.IsServer) { return; } integrity = GetComponent <Integrity>(); spriteHandler = GetComponentInChildren <SpriteHandler>(); if (CurrentState != powerCellAddedState) { stateful.ServerChangeState(initialState); } }
private void Awake() { circuitBoardSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); if (!CustomNetworkManager.IsServer) { return; } integrity = GetComponent <Integrity>(); spriteHandler = GetComponentInChildren <SpriteHandler>(); integrity.OnWillDestroyServer.AddListener(WhenDestroyed); if (CurrentState != partsAddedState) { stateful.ServerChangeState(initialState); } }
public void SetObjectActive(AnimationEvent animEvent) { string name = animEvent.stringParameter; int value = animEvent.intParameter; Stateful obj = GameManager.instance.GetStatefulOnScene(name); print(value); switch (value) { case 0: obj.ObjectActive(false); obj.gameObject.SetActive(false); break; case 1: obj.ObjectActive(true); obj.gameObject.SetActive(true); break; } }
/// <summary> /// Fires after the state of the object is restored. /// </summary> /// <param name="this"> /// </param> /// <param name="state"><p>The hash of state values returned from the StateProvider. This is passed /// to <b><tt>applyState</tt></b>. By default, that simply copies property values into this /// object. The method maybe overriden to provide custom state restoration.</p> /// </param> /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p> /// </param> public void staterestore(Stateful @this, object state, object eOpts) { }
private void Awake() { circuitBoardSlot = GetComponent <ItemStorage>().GetIndexedItemSlot(0); stateful = GetComponent <Stateful>(); objectBehaviour = GetComponent <ObjectBehaviour>(); }
public DeterministicState(Stateful stateful, object related) { Before = stateful.GetMementoAndApplyState(related); // generate memento before applying }
/// <summary> /// Fires after the state of the object is saved to the configured state provider. /// </summary> /// <param name="this"> /// </param> /// <param name="state"><p>The hash of state values. This is determined by calling /// <b><tt>getState()</tt></b> on the object. This method must be provided by the /// developer to return whetever representation of state is required, by default, <see cref="Ext.state.Stateful">Ext.state.Stateful</see> /// has a null implementation.</p> /// </param> /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p> /// </param> public void statesave(Stateful @this, object state, object eOpts) { }
/// <summary> /// Fires after the state of the object is restored. /// </summary> /// <param name="this"> /// </param> /// <param name="state"><p>The hash of state values returned from the StateProvider. This is passed /// to <b><tt>applyState</tt></b>. By default, that simply copies property values into this /// object. The method maybe overriden to provide custom state restoration.</p> /// </param> /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p> /// </param> public void staterestore(Stateful @this, object state, object eOpts){}
/// <summary> /// Fires after the state of the object is saved to the configured state provider. /// </summary> /// <param name="this"> /// </param> /// <param name="state"><p>The hash of state values. This is determined by calling /// <b><tt>getState()</tt></b> on the object. This method must be provided by the /// developer to return whetever representation of state is required, by default, <see cref="Ext.state.Stateful">Ext.state.Stateful</see> /// has a null implementation.</p> /// </param> /// <param name="eOpts"><p>The options object passed to <see cref="Ext.util.Observable.addListener">Ext.util.Observable.addListener</see>.</p> /// </param> public void statesave(Stateful @this, object state, object eOpts){}