예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            EntityContextBuilder builder = new EntityContextBuilder(new DataContext());
            _Controller = new EntityController(builder);
        }
예제 #2
0
    private void DealDamageToTarget(EntityController target)
    {
        if (target == null)
        {
            return;
        }

        target.TakeDamage(damage);
    }
 public GameStateController( EntityController entityController, InputController.UpdateWaveTimer updateWaveTimer )
 {
     this.updateWaveTimer = updateWaveTimer;
     StartWaveTimer( startTimeout );
     this.entityController = entityController;
     spawn = new Spawn( entityController );
     baraksModels = GameObject.FindObjectsOfType<BaraksModel>();
     AddHero();
 }
 public BaseUnitBehaviour( EntityController.GetTarget getTarget, EntityController.Faction faction, UnitViewPresenter myViewPresenter, AnimationController animationController)
 {
     this.myViewPresenter = myViewPresenter;
     this.animationController = animationController;
     myFaction = faction;
     this.navMeshAgent = myViewPresenter.navMeshAgent;
     GetTargetDelegate = getTarget;
     InitStateMachine();
 }
예제 #5
0
    // Use this for initialization
    protected virtual void Start()
    {
        m_controller = new EntityController(this);
        m_motor = new EntityMotor(this);
        m_body = GetComponent<CharacterController>();

        Debug.Log ("m_controller = " + m_controller);
        Debug.Log ("m_motor = " + m_motor);
        Debug.Log ("m_body = " + m_body);
    }
예제 #6
0
    protected bool HasHitTarget(EntityController target)
    {
        if (target == null)
        {
            return false;
        }

        bool hitTarget = target.selectionBounds.Contains(transform.position);
        return hitTarget;
    }
    public void Remove(EntityController eC)
    {
        entities.Remove(eC);
        if(currentPlayer == eC)
        {
            SkipAction();
            SkipAction();
        }

        if(entities.Count == 1)
        {
            EndGame();
        }
    }
예제 #8
0
    protected override void FireWeaponAtTarget(EntityController attackTarget)
    {
        base.FireWeaponAtTarget(attackTarget);

        Vector3 projectileSpawnPoint = transform.position;
        projectileSpawnPoint.x += (2.1f * transform.forward.x);
        projectileSpawnPoint.y += 1.4f;
        projectileSpawnPoint.z += (2.1f * transform.forward.z);

        GameObject gameObject = (GameObject)Instantiate(GameManager.activeInstance.GetEntityPrefab(projectileName),
            projectileSpawnPoint, transform.rotation);

        ProjectileController projectile = gameObject.GetComponent<ProjectileController>();
        projectile.currentRangeToTarget = 0.9f * weaponRange;
        projectile.target = attackTarget;
    }
예제 #9
0
 public BuildUnit(
     UnitCharacteristics characteristics, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath, 
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate,
     Action deleteVisualEffect )
     : base(characteristics, 
         faction, 
         effectsController, 
         updateCharacteristics, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate,
         deleteVisualEffect)
 {
 }
예제 #10
0
    protected bool IsVipAtDestination(EntityController vip)
    {
        if (vip == null)
        {
            return false;
        }

        float distanceThreshold = 3f;
        Vector3 currentPosition = vip.transform.position;

        bool atDestinationX = Mathf.Abs(destination.x - currentPosition.x) < distanceThreshold;

        bool atDestinationY = Mathf.Abs(destination.y - currentPosition.y) < distanceThreshold;

        bool atDestination = atDestinationX && atDestinationY;
        return atDestination;
    }
 public HeroUnitController( EntityController.Select entityControllerSelect,
     HeroViewPresentor unitViewPresenter,
     BaseUnit.UnitCharacteristics unitCharacteristics,
     EntityController.GetTarget getTarget,
     EntityController.Faction faction,
     DeathDestroy updateDeath, 
     EntityController.HeroResurrect heroResurrect,
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
     : base(entityControllerSelect, unitViewPresenter, unitCharacteristics, getTarget, faction, updateDeath, setUpdeteCharacteristicsDelegate)
 {
     this.updateDeath = updateDeath;
     EffectsController effectsController = new EffectsController();
     this.heroResurrect = heroResurrect;
     unitBehaviour.CallDeathFSMEvent();
     unitBehaviour = new HeroBehaviour( getTarget, faction, unitViewPresenter, animationController );
     unitModel = new HeroUnit( "Unit", unitCharacteristics, SpellInit( effectsController ), faction, effectsController, _UpdateCharacteristics, UpdateDeath, LevelUpEffect, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
     unitView = new HeroView( unitViewPresenter, Selected, GetDamage, ((HeroUnit)unitModel).GetXp );
 }
        public void Init()
        {
            _controller = new PresentationController(false);
            _sideController = new SidePanelViewControllerMock();
            _mainController = new MainViewControllerMock();
            _controller.ViewControllers.Add(_mainController);
            _controller.ViewControllers.Add(_sideController);

            ApplicationManager.Current.ObjectContainer = new ObjectContainer();

            _clientAdapter = new ClientAdapter();
            _clientController = new EntityController<Client>();
            ApplicationManager.Current.ObjectContainer.Register<IEntityController<Client>>(_clientController);

            _invoiceAdapter = new InvoiceAdapter();
            _invoiceController = new EntityController<Invoice>();
            ApplicationManager.Current.ObjectContainer.Register<IEntityController<Invoice>>(_invoiceController);
        }
예제 #13
0
 public BaseUnit( 
     UnitCharacteristics characteristics, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath,
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate, Action deleteVisualEffect )
 {
     this.deleteVisualEffect = deleteVisualEffect;
     this.setUpdeteCharacteristicsDelegate = setUpdeteCharacteristicsDelegate;
     setUpdeteCharacteristicsDelegate( UpdateBaseCharacteristics, false );
     updateCharacteristicsDelegate = updateCharacteristics;
     this.updateDeath = updateDeath;
     baseCharacteristics = characteristics;
     currentHp = baseCharacteristics.hp;
     this.faction = faction;
     this.effectsController = effectsController;
     UpdateCharacteristics( baseCharacteristics );
 }
예제 #14
0
 public HeroUnit( string name, 
     UnitCharacteristics characteristics, 
     Spell[] spells, 
     EntityController.Faction faction, 
     EffectsController effectsController, 
     BaseUnitController.UpdateCharacteristics updateCharacteristics, 
     BaseUnitController.Death updateDeath, 
     HeroUnitController.LevelUpEffectDelegate 
     levelUpEffect, BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate, Action deleteVisualEffect )
     : base(characteristics, 
         faction, 
         effectsController, 
         updateCharacteristics, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate, deleteVisualEffect)
 {
     this.spells = spells;
     this.levelUpEffect = levelUpEffect;
 }
    public BaseUnitController(
        EntityController.Select entityControllerSelect, 
        UnitViewPresenter unitViewPresenter, 
        BaseUnit.UnitCharacteristics unitCharacteristics, 
        EntityController.GetTarget getTarget, 
        EntityController.Faction faction, 
        DeathDestroy updateDeath,
        BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
    {
        this.updateDeath = updateDeath;

        animationController = new AnimationController( unitViewPresenter._animation );

        EffectsController effectsController = new EffectsController();

        tempNavMeshAgent = unitViewPresenter.navMeshAgent;

        this.entityControllerSelect = entityControllerSelect;
        unitBehaviour = new BaseUnitBehaviour( getTarget, faction, unitViewPresenter, animationController );
        unitModel = new BaseUnit(unitCharacteristics, faction, effectsController, _UpdateCharacteristics, UpdateDeath, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
        unitView = new BaseUnitView( unitViewPresenter, Selected, GetDamage );
    }
예제 #16
0
 public BuildController( EntityController.Select entityControllerSelect,
     BuildViewPresenter unitViewPresenter,
     BaseUnit.UnitCharacteristics unitCharacteristics,
     EntityController.GetTarget getTarget,
     EntityController.Faction faction,
     DeathDestroy updateDeath, 
     BaraksModel.SetUpdeteCharacteristicsDelegate setUpdeteCharacteristicsDelegate )
     : base(entityControllerSelect, 
         unitViewPresenter, 
         unitCharacteristics, 
         getTarget, 
         faction, 
         updateDeath, 
         setUpdeteCharacteristicsDelegate)
 {
     this.updateDeath = updateDeath;
     EffectsController effectsController = new EffectsController();
     unitBehaviour.CallDeathFSMEvent();
     unitBehaviour = new BuildBehaviour( getTarget, faction, unitViewPresenter, animationController );
     unitModel = new BuildUnit( unitCharacteristics, faction, effectsController, _UpdateCharacteristics, UpdateDeath, setUpdeteCharacteristicsDelegate, DeleteVisualEffect );
     BuildView unitView = new BuildView( unitViewPresenter, Selected, ((BuildUnit)unitModel).GetDamage );
     this.unitView = unitView;
 }
예제 #17
0
파일: Shock.cs 프로젝트: nomoid/GridWorld
 protected override void Hit(EntityController control)
 {
     control.combat.TakeDamage(controller.combat, 10);
     controller.combat.delayedActionMod -= actionRecovery;
     //hit = true;
 }
예제 #18
0
    private void ChangeSelection(EntityController otherEntity, PlayerController player)
    {
        if (otherEntity == this)
        {
            return;
        }

        SetSelection(false);
        if (player.selectedEntity != null)
        {
            player.selectedEntity.SetSelection(false);
        }

        player.selectedEntity = otherEntity;
        playingArea = HudController.GetPlayingArea();
        otherEntity.SetSelection(true);
    }
예제 #19
0
 public override void AddToGame(Game game)
 {
     this.entityController = Service.EntityController;
     this.nodeList         = this.entityController.GetNodeList <MovementNode>();
 }
예제 #20
0
 public void Heal(OutOfCombatHeal healInfo, EntityController entity)
 {
     StartCoroutine(HealCoroutine(healInfo, entity));
 }
예제 #21
0
    protected virtual void SetAttackTarget(EntityController target)
    {
        attackTarget = target;

        Vector3 targetPosition = attackTarget.transform.position;
        bool targetInRange = IsTargetInRange(targetPosition);
        if (targetInRange == true)
        {
            isAttacking = true;
            AttackTarget(attackTarget);
        }
        else
        {
            AdvanceTowardsTarget(targetPosition);
        }
    }
예제 #22
0
 public WraithStunState(EntityController controller) : base(controller)
 {
     stateName = "Stun";
 }
 /// <summary>
 /// Proceses the event.
 /// </summary>
 /// <param name="frame">The frame the event is on relative to it's start.</param>
 /// <param name="endFrame">The last frame of the event, relative to it's start.</param>
 /// <param name="attackState">The attack state using this event.</param>
 /// <param name="controller">The controller using this event.</param>
 /// <param name="variables"></param>
 /// <returns>True if the attack state should cancel.</returns>
 public virtual bool Evaluate(uint frame, uint endFrame, EntityController controller,
                              AttackEventVariables variables)
 {
     return(false);
 }
예제 #24
0
 public void Apply()
 {
     ec        = GetComponent <EntityController> ();
     ec.health = ec.health - damage;
     Component.Destroy(this);
 }
예제 #25
0
 // Use this for initialization
 void Start()
 {
     m_controller = GetComponent <EntityController>();
     dir          = 1;
 }
 public Crossbow_IdleState(EntityController controller) : base(controller)
 {
     stateName = "Idle";
 }
예제 #27
0
        private void LogChanges(ChangeTracker dbChangeTracker)
        {
            foreach (EntityEntry entity in dbChangeTracker.Entries().Where(obj => { return(obj.State == EntityState.Modified || obj.State == EntityState.Deleted); }))
            {
                if (BL.ApplicationDataContext.NonProxyType(entity.GetType()) == typeof(DB.SYS_Log))
                {
                    continue;
                }

                //LogObject logObject = new LogObject();

                //logObject.EntityType = BL.ApplicationDataContext.NonProxyType(entity.Entity.GetType());

                //if (entity.State == EntityState.Added)
                //    logObject.Action = EntityState.Added.ToString();
                //else if (entity.State == EntityState.Modified)
                //    logObject.Action = EntityState.Modified.ToString();
                //else if (entity.State == EntityState.Deleted)
                //    logObject.Action = EntityState.Deleted.ToString();

                switch (entity.State)
                {
                case EntityState.Modified:

                    foreach (string propertyName in entity.CurrentValues.Properties.Select(l => l.Name))
                    {
                        DB.SYS_Log sysLog = BL.SYS.SYS_Log.New;
                        sysLog.EntityId  = Convert.ToInt64(entity.CurrentValues["Id"]);
                        sysLog.TableName = BL.ApplicationDataContext.NonProxyType(entity.Entity.GetType()).Name;

                        if (propertyName == "CreatedOn" || propertyName == "CreatedBy" || propertyName == "Title")
                        {
                            continue;
                        }

                        sysLog.FieldName = propertyName;

                        if (entity.CurrentValues[propertyName] == null && entity.OriginalValues[propertyName] == null)
                        {
                        }
                        else if (entity.CurrentValues[propertyName] != null && entity.OriginalValues[propertyName] == null)
                        {
                            sysLog.OldValue = "";
                            sysLog.NewValue = entity.CurrentValues[propertyName].ToString();
                            EntityController.SaveSYS_Log(sysLog, this);
                        }
                        else if (entity.CurrentValues[propertyName] == null && entity.OriginalValues[propertyName] != null)
                        {
                            sysLog.OldValue = entity.OriginalValues[propertyName].ToString();
                            sysLog.NewValue = "";
                            EntityController.SaveSYS_Log(sysLog, this);
                        }
                        else if (entity.CurrentValues[propertyName].ToString() != entity.OriginalValues[propertyName].ToString())
                        {
                            sysLog.OldValue = entity.OriginalValues[propertyName].ToString();
                            sysLog.NewValue = entity.CurrentValues[propertyName].ToString();
                            EntityController.SaveSYS_Log(sysLog, this);
                        }
                    }
                    break;

                case EntityState.Deleted:
                    //if (BL.ApplicationDataContext.NonProxyType(entity.Entity.GetType()) != typeof(DB.ITM_InventorySupplier))
                    //    throw new Exception("Deleting Entries not allowed in this system implement and archive");
                    break;
                }

                //if (entity.State == EntityState.Added || entity.State == EntityState.Modified)
                //{
                //    System.Xml.Linq.XDocument currentValues = new System.Xml.Linq.XDocument(new System.Xml.Linq.XElement(logObject.EntityType.Name));

                //    foreach (string propertyName in entity.CurrentValues.PropertyNames)
                //    {
                //        currentValues.Root.Add(new System.Xml.Linq.XElement(propertyName, entity.CurrentValues[propertyName]));
                //    }

                //    logObject.NewData = System.Text.RegularExpressions.Regex.Replace(currentValues.ToString(), @"\r\n+", " ");
                //}

                //if (entity.State == EntityState.Modified || entity.State == EntityState.Deleted)
                //{
                //    System.Xml.Linq.XDocument originalValues = new System.Xml.Linq.XDocument(new System.Xml.Linq.XElement(logObject.EntityType.Name));

                //    foreach (string propertyName in entity.OriginalValues.PropertyNames)
                //    {
                //        originalValues.Root.Add(new System.Xml.Linq.XElement(propertyName, entity.OriginalValues[propertyName]));
                //    }

                //    logObject.OldData = System.Text.RegularExpressions.Regex.Replace(originalValues.ToString(), @"\r\n+", " ");
                //}


                //auditTrailList.Add(auditObject);
            }
        }
	public static EntityController GetInstance(){
		
		if(instance == null){
			instance = GameObject.FindObjectOfType(typeof(EntityController)) as EntityController;
		}
		
		if(instance == null){		
			//We'll need to attach one
			GameObject o = new GameObject("Entity Controller");
			instance = o.AddComponent<EntityController>();
		}
		
		return instance;
		
	}
예제 #29
0
파일: Shock.cs 프로젝트: nomoid/GridWorld
        //bool hit = false;

        //public Dictionary<KeyValuePair<int, int>, GameObject> anim;

        public ShockEvent(EntityController cont, float cd)
        {
            controller = cont;
            cooldown   = cd;
            //anim = new Dictionary<KeyValuePair<int, int>, GameObject>();
        }
예제 #30
0
파일: Program.cs 프로젝트: chargen/AGI-X0
        static void Main(string[] args)
        {
            {
                double[][] arr;

                arr    = new double[3][];
                arr[0] = new double[4] {
                    9, 8, 7, 6
                };
                arr[1] = new double[4] {
                    42, 13, 7, 2
                };
                arr[2] = new double[4] {
                    101, 102, 103, 104
                };

                MeshAttributeCLASSES meshComponent2 = MeshAttributeCLASSES.makeDouble4(arr);
                double[]             readback       = meshComponent2.getDouble4Accessor()[1];

                int breakPointHere = 42;
            }



            // test solver for trivial cases
            {
                double one = 1.0;

                double J11 = 1.0, J22 = 1.0, J33 = 1.0, // principal moments of inertia of the body
                       w1 = 0, w2 = 0, w3 = 0,          // angular velocity of spacecraft in spacecraft frame

                // result values
                       q1Dot, q2Dot, q3Dot, q4Dot,
                       w1Dot, w2Dot, w3Dot,

                // coeefficients, taken from the paper
                       gamma = 0.7,
                       aCoefficient = 1.25,
                       d = 7.5, k = 3.0, betaOne = 0.001;

                Quaternion spacecraftOrientationError;
                // set to identity

                /*
                 * spacecraftOrientationError.i = 0;
                 * spacecraftOrientationError.j = 0;
                 * spacecraftOrientationError.k = 0;
                 * spacecraftOrientationError.scalar = 1;
                 */
                spacecraftOrientationError = QuaternionUtilities.makeFromAxisAndAngle(new SpatialVectorDouble(new double[] { 1, 0, 0 }), 1.0);

                QuaternionFeedbackRegulatorForSpacecraft.calcControl(
                    J11, J22, J33,
                    spacecraftOrientationError.i, spacecraftOrientationError.j, spacecraftOrientationError.k, spacecraftOrientationError.scalar,
                    w1, w2, w3,
                    out q1Dot, out q2Dot, out q3Dot, out q4Dot,
                    out w1Dot, out w2Dot, out w3Dot,

                    aCoefficient,
                    gamma,
                    d, k,
                    betaOne
                    );

                // changes must be zero
                Debug.Assert(q1Dot == 0);
                Debug.Assert(q2Dot == 0);
                Debug.Assert(q3Dot == 0);
                Debug.Assert(q4Dot == 0);
                Debug.Assert(w1Dot == 0);
                Debug.Assert(w2Dot == 0);
                Debug.Assert(w3Dot == 0);

                int breakPointHere = 42;
            }



            SimplexSolver simplexSolver = new SimplexSolver();

            /* first example from video tutorial, https://www.youtube.com/watch?v=Axg9OhJ4cjg, bottom row is negative unlike in the video
             */
            simplexSolver.matrix       = Matrix.makeByRowsAndColumns(3, 5);
            simplexSolver.matrix[0, 0] = 4;
            simplexSolver.matrix[0, 1] = 8;
            simplexSolver.matrix[0, 2] = 1;
            simplexSolver.matrix[0, 3] = 0;
            simplexSolver.matrix[0, 4] = 24;

            simplexSolver.matrix[1, 0] = 2;
            simplexSolver.matrix[1, 1] = 1;
            simplexSolver.matrix[1, 2] = 0;
            simplexSolver.matrix[1, 3] = 1;
            simplexSolver.matrix[1, 4] = 10;

            simplexSolver.matrix[2, 0] = -3;
            simplexSolver.matrix[2, 1] = -4;
            simplexSolver.matrix[2, 2] = 0;
            simplexSolver.matrix[2, 3] = 0;
            simplexSolver.matrix[2, 4] = 0;

            simplexSolver.iterate();

            // result must be ~16.67
            Debug.Assert(simplexSolver.matrix[2, 4] > 16.6 && simplexSolver.matrix[2, 4] < 16.8);



            // TODO< move into unittest for Matrix >

            Matrix toInverseMatrix = new Matrix(2, 2);

            toInverseMatrix[0, 0] = 2.0f;
            toInverseMatrix[0, 1] = 1.0f;
            toInverseMatrix[1, 0] = 2.0f;
            toInverseMatrix[1, 1] = 2.0f;

            Matrix inversedMatrix = toInverseMatrix.inverse();

            Debug.Assert(System.Math.Abs(inversedMatrix[0, 0] - 1.0f) < 0.001f);
            Debug.Assert(System.Math.Abs(inversedMatrix[0, 1] - -0.5f) < 0.001f);
            Debug.Assert(System.Math.Abs(inversedMatrix[1, 0] - -1.0f) < 0.001f);
            Debug.Assert(System.Math.Abs(inversedMatrix[1, 1] - 1.0f) < 0.001f);



            // test pid controller
            if (false)
            {
                Pid.Configuration pidConfiguration = new Pid.Configuration();
                pidConfiguration.integral   = 0;
                pidConfiguration.derivative = 0.1;
                pidConfiguration.proportial = 0.3;

                Pid pid = Pid.makeByTargetAndConfiguration(0, pidConfiguration);

                double value = 1.0;

                double control;

                control = pid.step(value, 0.5);
                value  += control;

                for (int i = 0; i < 10; i++)
                {
                    control = pid.step(value, 0.5);
                    value  += control;

                    Console.WriteLine("value={0} control={1}", value, control);
                }

                int breakPointHere0 = 1;
            }



            EntityManager entityManager = new EntityManager();

            SolidResponsibility    solidResponsibility;
            EffectResponsibility   effectResponsibility;
            ThrusterResponsibility thrusterResponsibility;
            AttitudeAndAccelerationControlResponsibility attitudeAndAccelerationControlResponsibility;

            thrusterResponsibility = new ThrusterResponsibility();
            attitudeAndAccelerationControlResponsibility = new AttitudeAndAccelerationControlResponsibility(thrusterResponsibility);

            effectResponsibility = new EffectResponsibility();

            solidResponsibility         = new SolidResponsibility();
            solidResponsibility.mapping = new PhysicsObjectIdToSolidClusterMapping();



            EntityController entityController = new EntityController();



            IKeyboardInputHandler keyboardInputHandler = new PlayerShipControlInputHandler(entityController);

            KeyboardInputRemapper keyboardInputRemapper = new KeyboardInputRemapper(keyboardInputHandler);



            SoftwareRenderer softwareRenderer = new SoftwareRenderer();

            PrototypeForm prototypeForm = new PrototypeForm();

            prototypeForm.softwareRenderer = softwareRenderer;
            IGuiRenderer guiRenderer = prototypeForm.softwareGuiRenderer;

            GuiContext guiContext = new GuiContext(guiRenderer);

            prototypeForm.guiContext = guiContext;

            KeyboardEventRouterOfGui keyboardEventRouterOfGui = new KeyboardEventRouterOfGui(guiContext.selectionTracker);
            KeyboardInputRouter      keyboardInputRouter      = new KeyboardInputRouter(keyboardInputRemapper, keyboardEventRouterOfGui);

            prototypeForm.keyboardInputRouter = keyboardInputRouter;

            prototypeForm.Show();


            PhysicsEngine physicsEngine = new PhysicsEngine();

            solidResponsibility.physicsEngine = physicsEngine;

            physicsEngine.collisionHandlers.Add(new DefaultCollisionHandler()); // add the default collision handler for absorbing all particles


            AttachedForce thruster = new AttachedForce(
                new SpatialVectorDouble(new double[] { 0, 1, 0 }), // localLocation
                new SpatialVectorDouble(new double[] { 1, 0, 0 })  // localDirection
                );

            PhysicsComponent physicsComponent;

            {
                double mass = 1.0;

                Matrix inertiaTensor = InertiaHelper.calcInertiaTensorForCube(mass, 1.0, 1.0, 1.0);
                physicsComponent = physicsEngine.createPhysicsComponent(new SpatialVectorDouble(new double[] { 0, 0, 10 }), new SpatialVectorDouble(new double[] { 0, 0, 0 }), mass, inertiaTensor);
            }
            physicsComponent.attachedForces.Add(thruster);

            MeshComponent meshComponent = new MeshComponent();

            meshComponent.mesh          = new MeshWithExplicitFaces();
            meshComponent.mesh.faces    = new MeshWithExplicitFaces.Face[1];
            meshComponent.mesh.faces[0] = new MeshWithExplicitFaces.Face();
            meshComponent.mesh.faces[0].verticesIndices = new uint[] { 0, 1, 2 };

            { // create a VerticesWithAttributes with just positions
                MutableMeshAttribute positionMeshAttribute = MutableMeshAttribute.makeDouble4ByLength(4);
                positionMeshAttribute.getDouble4Accessor()[0] = new double[] { -1, -1, 0, 1 };
                positionMeshAttribute.getDouble4Accessor()[1] = new double[] { 1, -1, 0, 1 };
                positionMeshAttribute.getDouble4Accessor()[2] = new double[] { 0, 1, 0, 1 };
                positionMeshAttribute.getDouble4Accessor()[3] = new double[] { 0, 0, 1, 1 };

                VerticesWithAttributes verticesWithAttributes = new VerticesWithAttributes(new AbstractMeshAttribute[] { positionMeshAttribute }, 0);
                meshComponent.mesh.verticesWithAttributes = verticesWithAttributes;
            }

            //TransformedMeshComponent transformedMeshComponentForPhysics = new TransformedMeshComponent();
            //transformedMeshComponentForPhysics.meshComponent = meshComponent;

            IList <ColliderComponent> colliderComponents = new List <ColliderComponent>();

            {
                SpatialVectorDouble colliderComponentSize          = new SpatialVectorDouble(new double[] { 2, 2, 2 });
                SpatialVectorDouble colliderComponentLocalPosition = new SpatialVectorDouble(new double[] { 0, 0, 0 });
                SpatialVectorDouble colliderComponentLocalRotation = new SpatialVectorDouble(new double[] { 0, 0, 0 });

                ColliderComponent colliderComponent0 = ColliderComponent.makeBox(colliderComponentSize, colliderComponentLocalPosition, colliderComponentLocalRotation);
                colliderComponents.Add(colliderComponent0);
            }


            ///physicsEngine.physicsAndMeshPairs.Add(new PhysicsComponentAndCollidersPair(physicsComponent, colliderComponents));

            // same mesh for the visualization
            TransformedMeshComponent transformedMeshComponentForRendering = new TransformedMeshComponent();

            transformedMeshComponentForRendering.meshComponent = meshComponent;

            ///softwareRenderer.physicsAndMeshPairs.Add(new PhysicsComponentAndMeshPair(physicsComponent, transformedMeshComponentForRendering));



            physicsEngine.tick();


            // TODO< read object description from json and create physics and graphics objects >

            // TODO< read and create solid description from json >

            // create and store solids of rocket
            // refactored

            /*
             * if ( true ) {
             *
             *
             *  SolidCluster solidClusterOfRocket = new SolidCluster();
             *
             *  // create solid of rocket
             *  {
             *      SpatialVectorDouble solidSize = new SpatialVectorDouble(new double[] { 2, 2, 2 });
             *      double massOfSolidInKilogram = 1.0;
             *      IList<CompositionFraction> solidCompositionFractions = new List<CompositionFraction>() { new CompositionFraction(new Isotope("Fe56"), massOfSolidInKilogram) };
             *      Composition solidComposition = new Composition(solidCompositionFractions);
             *
             *      physics.solid.Solid solid = physics.solid.Solid.makeBox(solidComposition, solidSize);
             *
             *      SpatialVectorDouble solidLocalPosition = new SpatialVectorDouble(new double[] { 0, 0, 0 });
             *      SpatialVectorDouble solidLocalRotation = new SpatialVectorDouble(new double[] { 0, 0, 0 });
             *
             *      solidClusterOfRocket.solids.Add(new SolidCluster.SolidWithPositionAndRotation(solid, solidLocalPosition, solidLocalRotation));
             *  }
             *
             *  /// TODO, uncommented because it uses the not existing physics object
             *  /// solidResponsibility.mapping.physicsObjectIdToSolidCluster[rocketPhysicsObject.id] = solidClusterOfRocket;
             * }
             */


            // add test particle
            if (false)
            {
                SpatialVectorDouble particlePosition = new SpatialVectorDouble(new double[] { 0, 0, 0 });
                SpatialVectorDouble particleVelocity = new SpatialVectorDouble(new double[] { 0, 0, 1 });

                PhysicsComponent particlePhysicsComponent = physicsEngine.createPhysicsComponent(particlePosition, particleVelocity, 1.0, null);
                physicsEngine.addParticle(particlePhysicsComponent);
            }


            // write game object for TestMissile
            if (true)
            {
                DemoObjectSerializer.seralizeAndWriteShip();
                DemoObjectSerializer.serializeAndWriteMissile();
            }

            GameObjectBuilder gameObjectBuilder = new GameObjectBuilder();

            gameObjectBuilder.physicsEngine          = physicsEngine;
            gameObjectBuilder.softwareRenderer       = softwareRenderer;
            gameObjectBuilder.solidResponsibility    = solidResponsibility;
            gameObjectBuilder.effectResponsibility   = effectResponsibility;
            gameObjectBuilder.thrusterResponsibility = thrusterResponsibility;
            gameObjectBuilder.attitudeAndAccelerationControlResponsibility = attitudeAndAccelerationControlResponsibility;



            // load missile game object from json and construct it
            if (false)
            {
                GameObjectTemplate deserilizedGameObjectTemplate;

                // load
                {
                    List <string> uriParts = new List <string>(AssemblyDirectory.Uri.Segments);
                    uriParts.RemoveAt(0); // remove first "/"
                    uriParts.RemoveRange(uriParts.Count - 4, 4);
                    uriParts.AddRange(new string[] { "gameResources/", "prototypingMissile.json" });
                    string path = string.Join("", uriParts).Replace('/', '\\').Replace("%20", " ");

                    string fileContent = File.ReadAllText(path);

                    deserilizedGameObjectTemplate = GameObjectTemplate.deserialize(fileContent);
                }

                // build game object from template
                Entity createdEntity;
                {
                    SpatialVectorDouble globalPosition = new SpatialVectorDouble(new double[] { 0, 0, 5 });
                    SpatialVectorDouble globalVelocity = new SpatialVectorDouble(new double[] { 0, 0, 0 });
                    createdEntity = gameObjectBuilder.buildFromTemplate(deserilizedGameObjectTemplate, globalPosition, globalVelocity);
                    entityManager.addEntity(createdEntity);
                }

                // manually add components
                {
                    // TODO< chemical explosive ignition component >
                    DummyComponent chemicalExplosiveIgnitionComponent = new DummyComponent();

                    // remap proximityEnter to explode
                    EventRemapperComponent eventRemapper = new EventRemapperComponent(chemicalExplosiveIgnitionComponent);
                    eventRemapper.eventTypeMap["proximityEnter"] = "explode";


                    // TODO< blacklist somehow other missiles >
                    PhysicsComponent           parentPhysicsComponent = createdEntity.getSingleComponentsByType <PhysicsComponent>();
                    ProximityDetectorComponent proximityDetector      = ProximityDetectorComponent.makeSphereDetector(physicsEngine, parentPhysicsComponent, 20.0, eventRemapper);
                    entityManager.addComponentToEntity(createdEntity, proximityDetector);
                }
            }

            Entity playerShip;

            if (true)
            {
                GameObjectTemplate deserilizedGameObjectTemplate;

                // load
                {
                    List <string> uriParts = new List <string>(AssemblyDirectory.Uri.Segments);
                    uriParts.RemoveAt(0); // remove first "/"
                    uriParts.RemoveRange(uriParts.Count - 4, 4);
                    uriParts.AddRange(new string[] { "gameResources/", "prototypingShip.json" });
                    string path = string.Join("", uriParts).Replace('/', '\\').Replace("%20", " ");

                    string fileContent = File.ReadAllText(path);

                    deserilizedGameObjectTemplate = GameObjectTemplate.deserialize(fileContent);
                }

                // build game object from template
                {
                    SpatialVectorDouble globalPosition = new SpatialVectorDouble(new double[] { 0, 0, 10 });
                    SpatialVectorDouble globalVelocity = new SpatialVectorDouble(new double[] { 0, 0, 0 });
                    Entity createdEntity = gameObjectBuilder.buildFromTemplate(deserilizedGameObjectTemplate, globalPosition, globalVelocity);
                    entityManager.addEntity(createdEntity);

                    playerShip = createdEntity;
                }
            }


            Entity                aiShip           = null;
            EntityController      aiShipController = new EntityController();
            VehicleAlignToCommand command          = null;

            bool withTestAiShip = true;

            if (withTestAiShip)
            {
                GameObjectTemplate deserilizedGameObjectTemplate;

                // load
                {
                    List <string> uriParts = new List <string>(AssemblyDirectory.Uri.Segments);
                    uriParts.RemoveAt(0); // remove first "/"
                    uriParts.RemoveRange(uriParts.Count - 4, 4);
                    uriParts.AddRange(new string[] { "gameResources/", "prototypingShip.json" });
                    string path = string.Join("", uriParts).Replace('/', '\\').Replace("%20", " ");

                    string fileContent = File.ReadAllText(path);

                    deserilizedGameObjectTemplate = GameObjectTemplate.deserialize(fileContent);
                }

                // build game object from template
                {
                    SpatialVectorDouble globalPosition = new SpatialVectorDouble(new double[] { 0, 0, 10 });
                    SpatialVectorDouble globalVelocity = new SpatialVectorDouble(new double[] { 0, 0, 0 });
                    Entity createdEntity = gameObjectBuilder.buildFromTemplate(deserilizedGameObjectTemplate, globalPosition, globalVelocity);
                    entityManager.addEntity(createdEntity);

                    aiShip = createdEntity;
                }

                { // control
                    aiShip.getSingleComponentsByType <VehicleControllerComponent>().controller = aiShipController;
                }

                { // AI initialization
                    double dt = 1.0 / 60.0;
                    SpatialVectorDouble targetDirection = new SpatialVectorDouble(new double[] { 1, 0, 0.1 }).normalized();
                    double targetDerivationDistance     = 0.001;
                    ulong  targetPhysicsObjectId        = aiShip.getSingleComponentsByType <PhysicsComponent>().id;

                    command = VehicleAlignToCommand.makeByGettingPidConfigurationFromAttitudeAndAccelerationControlResponsibility(
                        attitudeAndAccelerationControlResponsibility,
                        physicsEngine,
                        dt,
                        targetDirection,
                        aiShipController,
                        targetPhysicsObjectId,
                        targetDerivationDistance);
                }
            }


            //
            {
            }



            playerShip.getSingleComponentsByType <VehicleControllerComponent>().controller = entityController;



            // create test GUI
            {
                Button button = new subsystems.gui.Button();
                button.position  = new SpatialVectorDouble(new double[] { 0.2, 0.2 });
                button.size      = new SpatialVectorDouble(new double[] { 0.3, 0.1 });
                button.text      = "[Gamesave05-res.save](35)";
                button.textScale = new SpatialVectorDouble(new double[] { 0.05, 0.08 });

                guiContext.addGuiElement(button);
            }


            ulong frameCounter = 0;

            ulong debugFrameCounter        = 0; // used to limit the frames we do for debugging a scenario
            bool  isFixedScenarioDebugMode = false;

            // TODO< use logger >
            StreamWriter debugLogFileOfVariables = null; // used to debug variables and coeeficients of the debug scenario

            if (isFixedScenarioDebugMode)
            {
                if (!File.Exists("E:\\myLogShipOrientation.txt"))
                {
                    using (var stream = File.Create("E:\\myLogShipOrientation.txt"));
                }
                debugLogFileOfVariables = File.AppendText("E:\\myLogShipOrientation.txt");
            }

            for (;;)
            {
                Console.WriteLine("frame={0}", frameCounter);

                guiContext.tick();

                physicsEngine.tick();

                if (!isFixedScenarioDebugMode)
                {
                    prototypeForm.Refresh();

                    Application.DoEvents(); // HACK, EVIL
                }

                // AI
                {
                    // we just do this small AI because we are testing
                    if (false && aiShip != null)
                    {
                        command.process();
                    }
                }

                // AI - attitude control test
                //  we change the rotation velocity of the spacecraft directly to simulate "perfect" thruster control
                {
                    PhysicsComponent objectOfControlledSpacecraft = aiShip.getSingleComponentsByType <PhysicsComponent>();

                    double
                    // principal moments of inertia of the body
                    // the controller assumes that the body has an inertia tensor like an box, but small derivations are propably fine, too
                        J11 = objectOfControlledSpacecraft.inertiaTensor[0, 0], J22 = objectOfControlledSpacecraft.inertiaTensor[1, 1], J33 = objectOfControlledSpacecraft.inertiaTensor[2, 2],

                    // angular velocity of spacecraft in spacecraft frame
                        w1 = objectOfControlledSpacecraft.eulerLocalAngularVelocity.x,
                        w2 = objectOfControlledSpacecraft.eulerLocalAngularVelocity.y,
                        w3 = objectOfControlledSpacecraft.eulerLocalAngularVelocity.z,

                    // result values
                        q1Dot, q2Dot, q3Dot, q4Dot,
                        w1Dot, w2Dot, w3Dot,

                    // coeefficients, taken from the paper
                        gamma = 0.7,
                        aCoefficient = 1.25,
                        d = 7.5, k = 3.0, betaOne = 0.001;

                    // calculate the rotation delta to our target orientation from the current orientation
                    double debugMagnitude = objectOfControlledSpacecraft.rotation.magnitude;

                    Quaternion spacecraftOrientationError = objectOfControlledSpacecraft.rotation.difference(QuaternionUtilities.makeFromEulerAngles(0, 0.5, 0));

                    QuaternionFeedbackRegulatorForSpacecraft.calcControl(
                        J11, J22, J33,
                        spacecraftOrientationError.i, spacecraftOrientationError.j, spacecraftOrientationError.k, spacecraftOrientationError.scalar,
                        w1, w2, w3,
                        out q1Dot, out q2Dot, out q3Dot, out q4Dot,
                        out w1Dot, out w2Dot, out w3Dot,

                        aCoefficient,
                        gamma,
                        d, k,
                        betaOne
                        );

                    Console.WriteLine(
                        "w1dot={0}, w2dot={1}, w3dot={2}", w1Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture), w2Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture), w3Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture)
                        );

                    if (isFixedScenarioDebugMode)
                    {
                        debugLogFileOfVariables.WriteLine("w1dot={0}, w2dot={1}, w3dot={2}", w1Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture), w2Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture), w3Dot.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture));
                        debugLogFileOfVariables.Flush();
                    }

                    // access directly
                    objectOfControlledSpacecraft.eulerLocalAngularVelocity.x += (w1Dot * (1.0 / 60.0));
                    objectOfControlledSpacecraft.eulerLocalAngularVelocity.y += (w2Dot * (1.0 / 60.0));
                    objectOfControlledSpacecraft.eulerLocalAngularVelocity.z += (w3Dot * (1.0 / 60.0));
                }

                attitudeAndAccelerationControlResponsibility.resetAllThrusters();

                entityManager.updateAllEntities();

                // order after update is important
                attitudeAndAccelerationControlResponsibility.limitAllThrusters();
                attitudeAndAccelerationControlResponsibility.transferThrusterForce();

                //thruster.forceInNewton = 0.5 * entityController.inputAcceleration;

                if (!isFixedScenarioDebugMode)
                {
                    Thread.Sleep((int)((1.0 / 60.0) * 1000.0));
                }

                if (isFixedScenarioDebugMode)
                {
                    debugLogFileOfVariables.WriteLine("{0},", aiShip.getSingleComponentsByType <PhysicsComponent>().rotation.j.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture));
                    debugLogFileOfVariables.Flush();
                }
                //File.AppendText("E:\\myLogShipOrientation.txt").WriteLine("{0},", aiShip.getSingleComponentsByType<PhysicsComponent>().rotation.y);

                if (isFixedScenarioDebugMode && debugFrameCounter >= 8000)   // 30000
                {
                    break;
                }

                debugFrameCounter++;

                frameCounter++;
            }
        }
예제 #31
0
 public HeroBehaviour( EntityController.GetTarget getTarget, EntityController.Faction faction, UnitViewPresenter myViewPresenter, AnimationController animationController )
     : base(getTarget, faction, myViewPresenter, animationController)
 {
     InitStateMachine();
 }
예제 #32
0
 public void SetTarget(EntityController _motion)
 {
     motion = _motion;
 }
 public TowerNotificationCenter(EntityController controller) : base(controller)
 {
     this.towerController = (TowerController)controller;
 }
예제 #34
0
 /// <summary>
 /// Skeleton function. This checks additional requirements for the spell's success.
 /// </summary>
 public virtual bool CheckCanCast(EntityController user, EntityController target)
 {
     return(true);
 }
예제 #35
0
 public static EntityController Fixture()
 {
     EntityController controller = new EntityController(new EntityRepository(), "", new LoginView());
     return controller;
 }
예제 #36
0
 /// <summary>
 /// Skeleton function. This checks if the spell will hit the target.
 /// </summary>
 public virtual bool CheckSpellHit(EntityController user, EntityController target)
 {
     return(true);
 }
예제 #37
0
 private void SelectEntity(EntityController entityToSelect)
 {
     player.selectedEntity = entityToSelect;
     entityToSelect.SetSelection(true);
 }
예제 #38
0
    public List <Effect> spellProperties;         // Used to modify the damage roll


    /// <summary>
    /// Returns an instance of this spell using the spell data to calculate damage and effects
    /// </summary>
    public SpellCast Cast(EntityController user, EntityController target)
    {
        // Result of the cast spell
        SpellCast result = new SpellCast();

        result.spell  = this;
        result.user   = user;
        result.target = target;

        // Check for MP. If MP is inadequate, don't proceed.
        result.success = CheckMP(user);

        if (result.success)
        {
            // Check for additional requirements. If they aren't met, don't proceed.
            result.success = CheckCanCast(user, target);

            if (result.success)
            {
                // Apply properties before dealing damage, as properties may affect damage or accuracy.
                List <EffectInstance> properties = new List <EffectInstance>();

                // Activate all properties on this spell
                foreach (Effect e in spellProperties)
                {
                    if (e != null && !properties.Exists(f => f.effect == e) || (properties.Exists(f => f.effect == e) && e.IsStackable()))
                    {
                        EffectInstance eff = e.CreateEventInstance(user, target, result);
                        eff.CheckSuccess();
                        eff.OnActivate();
                        properties.Add(eff);
                    }
                }

                // Get the user's active propeties. This will differ from the above list.
                List <EffectInstance> userProperties = user.GetProperties();

                foreach (EffectInstance ef in userProperties)
                {
                    ef.CheckSuccess();
                    ef.OnActivate();
                    properties.Add(ef);
                }

                // Check for spell hit. If spell misses, don't proceed.
                result.success = CheckSpellHit(user, target);

                if (result.success)
                {
                    // Calculate damage
                    CalculateDamage(user, target, result);

                    // If damage is 0, check to see if any effects were applied.
                    if (result.GetDamage() == 0)
                    {
                        result.success = result.GetEffectProcSuccess();
                    }
                }

                // Deactivate all properties
                foreach (EffectInstance e in properties)
                {
                    e.OnDeactivate();
                }

                // Clear properties from player
                user.ClearProperties();
            }
        }

        // Return spell cast.
        return(result);
    }
예제 #39
0
파일: Entity.cs 프로젝트: charliehuge/GGJ13
    //If we've already done this, it's OK. It is still nice to have a standard initialization function
    //from which we can derive
    //We won't do this on Awake or Start, however - we will leave this to the discretion of the developer
    //It depends on when they wish to create their map and bind their entities
    public void InitializeEntity()
    {
        //We'll cache our transform, as we'll be calling it frequently in order to check our position
        eTransform = transform;

        eTransform.parent = parentMap.transform;

        this.controller = EntityController.GetInstance();

        this.controller.SubscribeEntity(this);

        //Initialize our ground position
        Collider c = gameObject.collider;

        if(c != null){

            yGroundOffset = c.bounds.center.y - c.bounds.min.y;

        }

        InitializeMapPosition();

        OnInitializeEntity();
    }
예제 #40
0
 public RenderSystem(SpriteBatch spriteBatch, GraphicsDevice graphicsDevice, EntityController entityController)
 {
     this.graphicsDevice   = graphicsDevice;
     this.entityController = entityController;
     this.spriteBatch      = spriteBatch;
 }
예제 #41
0
 /// <summary>
 /// Работа с сущностью при нажатии ОК.
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="ec"></param>
 public abstract void ApplyChanged(EntityBase entity, EntityController ec);
 protected override void Hit(EntityController control)
 {
     //Do nothing
 }
예제 #43
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     entityController = new EntityController(GraphicsDevice);
     base.Initialize();
 }
예제 #44
0
    public void SetWaypoint(EntityController target)
    {
        if (target == null)
        {
            return;
        }

        SetWaypoint(target.transform.position);
        targetEntityGameObject = target.gameObject;
    }
예제 #45
0
파일: Shock.cs 프로젝트: nomoid/GridWorld
 public override SkillEvent GetSkillEvent(EntityController controller)
 {
     return(new ShockEvent(controller, cd));
 }
예제 #46
0
 protected void TakeOwnershipOfEntity(EntityController entity, string entityType)
 {
     GameObject group = transform.Find(entityType).gameObject;
     entity.transform.parent = group.transform;
 }
예제 #47
0
 public virtual void BindEntityController(EntityController controller)
 {
     this.controller = controller as DisplayableEntityController;
 }
예제 #48
0
 public override void Enter(EntityController cont)
 {
     cont.rotateRestTime = Random.Range(rotateRestMin, rotateRestMax);
 }
예제 #49
0
 private void Start()
 {
     ec     = gameObject.GetComponent <EntityController>();
     health = 100;
 }
예제 #50
0
 private void Awake()
 {
     controller = GetComponentInParent <EntityController>();
 }
예제 #51
0
 public DevourerStunState(EntityController controller) : base(controller)
 {
     stateName = "Stun";
 }
예제 #52
0
 /*
  * The on hit function.
  */
 public abstract void OnHit(EntityController en);
예제 #53
0
    private void AttackTarget(EntityController attackTarget)
    {
        if (attackTarget == null)
        {
            isAttacking = false;
            return;
        }

        Vector3 targetPosition = attackTarget.transform.position;
        bool targetInRange = IsTargetInRange(targetPosition);
        if (targetInRange == false)
        {
            AdvanceTowardsTarget(targetPosition);
            return;
        }

        bool targetInSights = IsTargetInSights(targetPosition);
        if (targetInSights == false)
        {
            GetBearingToTarget(targetPosition);
            return;
        }

        bool readyToFire = IsReadyToFire();
        if (readyToFire == false)
        {
            return;
        }

        FireWeaponAtTarget(attackTarget);
    }
예제 #54
0
    protected EntityController EntityFromCollision(Collision2D collision)
    {
        EntityController en = collision.gameObject.GetComponent <EntityController>();

        return(en);
    }
예제 #55
0
 public void OnEnterRange(EntityController entity)
 {
 }
예제 #56
0
 void Awake()
 {
     _entityController = GetComponent <EntityController>();
 }
예제 #57
0
    protected void LoadAttackTarget(int entityId)
    {
        if (entityId < 0)
        {
            return;
        }

        try
        {
            attackTarget = (EntityController)GameManager.activeInstance.GetGameEntityById(entityId);
        }
        catch
        {
            Debug.Log(string.Format("Failed to load Attack target"));
        }
    }
예제 #58
0
 public EntityMVC(EntityModel model, EntityController controller)
 {
     Model      = model;
     Controller = controller;
 }
예제 #59
0
 protected void OtherEntitySetup(EntityController entity, string entityType)
 {
     switch (entityType)
     {
         case PlayerProperties.STRUCTURES:
             StructureController structure = (StructureController)entity;
             if (structure.isConstructionComplete == false)
             {
                 structure.SetTransparencyMaterial(allowedMaterial, true);
             }
             break;
     }
 }
예제 #60
0
 void Start()
 {
     player = new Player( SetCurrentTargetSpell, SetCurrentPositionSpell, SetCursor );
     entityController = new EntityController( player, redMainTarget, blueMainPosition.gameObject.transform.position, buildViewPresenter );
     gameStateController = new GameStateController( entityController, _UpdateWaveTimer );
 }