Ejemplo n.º 1
0
 public SimUnitInstance(Simulation sim, SimUnitConfig unit, Vector3 startpos, ISimUnitEventHandler handler) : base(sim, unit, startpos)
 {
     Health          = unit.Health;
     UnitConfig      = unit;
     eventhandler    = handler;
     this.OnDestroy += handler.OnDestroyEventHandler;
 }
Ejemplo n.º 2
0
    public SimUnitInstance AddUnit(SimUnitConfig unittype, Vector3 startingposition, ISimUnitEventHandler EventHandler)
    {
        SimUnitInstance inst = new SimUnitInstance(this, unittype, startingposition, EventHandler);

        if (unittype.Team == SimUnitConfig.ETeam.Friendly)
        {
            FriendlySimUnits.Add(inst);
        }
        else
        {
            EnemySimUnits.Add(inst);
        }
        return(inst);
    }