コード例 #1
0
ファイル: UnitWave.cs プロジェクト: GodLesZ/svn-dump
		public virtual void Initialize() {
			if( mThisWave < 10 )
				mUnitType = EUnitType.Basic;

			mMaxX = mTile;
			mMaxY = mTile;
		}
コード例 #2
0
        private void SetMethodUnit(EUnitType unitType, int unitTo)
        {
            switch (unitType)
            {
            case EUnitType.AirFlow:
                method.AirFlow = (EUnitAirFlow)unitTo;
                break;

            case EUnitType.Capacity:
            case EUnitType.EER_COP:
                method.CoolingCapacity = (EUnitCapacity)unitTo;
                break;

            case EUnitType.Enthalpy:
            case EUnitType.Heat:
                method.Enthalpy = (EUnitEnthalpy)unitTo;
                break;

            case EUnitType.Temperature:
                method.Temperature = (EUnitTemperature)unitTo;
                break;

            case EUnitType.Pressure:
                method.Pressure = (EUnitPressure)unitTo;
                break;

            case EUnitType.DiffPressure:
                method.DiffPressure = (EUnitDiffPressure)unitTo;
                break;

            case EUnitType.AtmPressure:
                method.AtmPressure = (EUnitAtmPressure)unitTo;
                break;
            }
        }
コード例 #3
0
        public void SpawnObject(int index)
        {
            if (this.PrefabsToInstantiate != null && index < this.PrefabsToInstantiate.Count)
            {
                MyType    = (EUnitType)index;
                EnemyType = MyType == EUnitType.FirstPlayer ? EUnitType.SecondPlayer : EUnitType.FirstPlayer;

                var prefab = this.PrefabsToInstantiate[index];

                if (prefab == null)
                {
                    return;
                }
#if UNITY_EDITOR
                Debug.Log("Auto-Instantiating: " + prefab.name);
#endif
                Vector3 spawnPos; Quaternion spawnRot;
                GetSpawnPoint(index, out spawnPos, out spawnRot);

                PhotonNetwork.Instantiate(EventHandler.name, spawnPos, spawnRot);

                var newobj = PhotonNetwork.Instantiate(prefab.name, spawnPos, spawnRot, 0);

                SpawnedObjects.Push(newobj);
            }
        }
コード例 #4
0
        private void AddUnitAvailable(EUnitType type, int qty = 1)
        {
            int unit = GetUnitAvailable(type);

            unit += qty;
            SetUnitAvailable(type, unit);
        }
コード例 #5
0
        public void SetUnitTo(EUnitType type, int unit)
        {
            Lock();

            try
            {
                foreach (KeyValuePair <string, ValueRow> row in Const)
                {
                    if (row.Value.Unit.Type == type)
                    {
                        row.Value.Unit.To = unit;
                    }
                }

                foreach (KeyValuePair <string, ValueRow> row in Calcurated)
                {
                    if (row.Value.Unit.Type == type)
                    {
                        row.Value.Unit.To = unit;
                    }
                }

                foreach (KeyValuePair <string, ValueRow> row in Measured)
                {
                    if (row.Value.Unit.Type == type)
                    {
                        row.Value.Unit.To = unit;
                    }
                }
            }
            finally
            {
                Unlock();
            }
        }
コード例 #6
0
        private void SetLevel(EUnitType type, int lvl)
        {
            switch (type)
            {
            case EUnitType.Archer:
                _archerLVL      = lvl;
                _archerHP       = _archerBaseHP * _archerLVL;
                _archerDMG      = _archerBaseDMG * _archerLVL;
                _recruitBowCost = _recruitBaseBowCost * _archerLVL;
                _upgradeBowCost = _upgradeBaseBowCost * _archerLVL;
                break;

            case EUnitType.Swordsman:
                _swordsmanLVL     = lvl;
                _swordsmanHP      = _swordsmanBaseHP * _swordsmanLVL;
                _swordsmanDMG     = _swordsmanBaseDMG * _swordsmanLVL;
                _recruitSwordCost = _recruitBaseSwordCost * _swordsmanLVL;
                _upgradeSwordCost = _upgradeBaseSwordCost * _swordsmanLVL;
                break;

            case EUnitType.Spearman:
                _spearmanLVL      = lvl;
                _spearmanHP       = _spearmanBaseHP * _spearmanLVL;
                _spearmanDMG      = _spearmanBaseDMG * _spearmanLVL;
                _recruitSpearCost = _recruitBaseSpearCost * _spearmanLVL;
                _upgradeSpearCost = _upgradeBaseSpearCost * _spearmanLVL;
                break;
            }
        }
コード例 #7
0
        private double GetRatio(EUnitType type, int from, int to)
        {
            double ratio = 0;

            switch (type)
            {
            case EUnitType.AirFlow:
                ratio = GetAirFlowRatio((EUnitAirFlow)from, (EUnitAirFlow)to);
                break;

            case EUnitType.Capacity:
            case EUnitType.Enthalpy:
            case EUnitType.Heat:
            case EUnitType.EER_COP:
                ratio = GetCapacityRatio((EUnitCapacity)from, (EUnitCapacity)to);
                break;

            case EUnitType.Pressure:
                ratio = GetPressureRatio((EUnitPressure)from, (EUnitPressure)to);
                break;

            case EUnitType.AtmPressure:
                ratio = GetAtmPressureRatio((EUnitAtmPressure)from, (EUnitAtmPressure)to);
                break;

            case EUnitType.DiffPressure:
                ratio = GetDiffPressureRatio((EUnitDiffPressure)from, (EUnitDiffPressure)to);
                break;
            }

            return(ratio);
        }
コード例 #8
0
 public UnitConvert(EUnitType type, int from, int to, bool enabled = true)
 {
     Type    = type;
     From    = from;
     To      = to;
     Enabled = enabled;
 }
コード例 #9
0
 private void SetPlotSeriesUnit(int index, EUnitType unitType, int unitTo)
 {
     foreach (TabPage page in graphTab.TabPages)
     {
         (page.Controls[0] as CtrlViewGraphPanel)
         .SetPlotSeriesUnit(index, unitType, unitTo);
     }
 }
コード例 #10
0
 public static double ConvertDegreeTo(double rate, EUnitType futureUnit)
 {
     return(futureUnit switch
     {
         EUnitType.Kilometer => (rate * DegreeOnKilometers),
         EUnitType.Meter => (rate * DegreeOnMeters),
         _ => - 1
     });
コード例 #11
0
        private void Shot(int damage, EUnitType unitType, Vector3 position, Quaternion rotation, Vector3 dir, float speed)
        {
            photonView = PhotonView.Get(this);

            var gameObject = PoolSystem.Pop();

            gameObject.SetActive(true);

            ref var newBulletComponent    = ref gameObject.GetComponent <BulletProvider>().GetData(out _);
コード例 #12
0
 public static InvoiceItem Create(
     string name,
     decimal unitPrice,
     EUnitType unitType,
     decimal discount,
     double quantity
     )
 {
     return(new InvoiceItem(null, name, unitPrice, unitType, discount, quantity));
 }
コード例 #13
0
        public virtual void Initialize()
        {
            if (mThisWave < 10)
            {
                mUnitType = EUnitType.Basic;
            }

            mMaxX = mTile;
            mMaxY = mTile;
        }
コード例 #14
0
ファイル: UnitWave.cs プロジェクト: GodLesZ/svn-dump
		public UnitWave( EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval ) {
			mThisWave = DefenderWorld.Instance.Status.Wave;
			mSpawningPoint = spawn;
			mTile = tileSize;
			mUnitType = unitType;
			mToCreate = numUnits;
			mInterval = interval;

			Initialize();
		}
コード例 #15
0
        public UnitWave(EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval)
        {
            mThisWave      = DefenderWorld.Instance.Status.Wave;
            mSpawningPoint = spawn;
            mTile          = tileSize;
            mUnitType      = unitType;
            mToCreate      = numUnits;
            mInterval      = interval;

            Initialize();
        }
コード例 #16
0
ファイル: LevelModel.cs プロジェクト: JansonC/Zero2DGameDemo
        public bool IsType(ushort x, ushort y, EUnitType unitType)
        {
            var vo = GetUnitVO(x, y);

            if (null == vo || vo.type != unitType)
            {
                return(false);
            }

            return(true);
        }
コード例 #17
0
        public override IUnit CreateUnit(EUnitType unitType)
        {
            switch (unitType)
            {
            case EUnitType.Distroyer:
                return(new CDistroyer());

            default:
                throw new Exception("指定了错误的海中单位类型");
            }
        }
コード例 #18
0
        public override IUnit CreateUnit(EUnitType unitType)
        {
            switch (unitType)
            {
            case EUnitType.Soldier:
                return(new CSoldier());

            default:
                throw new Exception("指定了错误的陆地单位类型");
            }
        }
コード例 #19
0
ファイル: Managers.cs プロジェクト: Wirdal/MONOWar
        public void CreateUnit(EUnitType type, EUnitColor color, Tile tile)
        {
            switch (type)
            {
            case EUnitType.Infantry:
                units.Add(new Infantry(color, tile));
                break;

            default:
                break;
            }
        }
コード例 #20
0
    public static Unit CreateUnit(string res, EUnitType unitType)
    {
        GameObject unitGo = Object.Instantiate(Resources.Load(res)) as GameObject;
        Unit       unit   = unitGo.GetComponent <Unit>();

        if (unit == null)
        {
            unit = unitGo.AddComponent <Unit>();
        }
        unit.ID       = IdGenerater.GenerateId();
        unit.UnitType = unitType;
        return(unit);
    }
コード例 #21
0
        protected virtual int BuildWave()
        {
            int spawn = mSpawnRand.Next(Spawns.Count);

            UnitType++;
            if ((int)UnitType >= (int)EUnitType.MAX)
            {
                UnitType = EUnitType.Basic;
            }

            mWaves.Add(new UnitWave(UnitType, Spawns[spawn], SpawnSize, TileSize, mUnitInterval));
            return(spawn);
        }
コード例 #22
0
ファイル: UnitGaugeMark.cs プロジェクト: zunaalabaya/TAC-BOT
        public void ChangeAnimationByUnitType(EUnitType Type)
        {
            switch (Type)
            {
            case EUnitType.Treasure:
                this.MarkType = UnitGaugeMark.EMarkType.MapChest;
                break;

            case EUnitType.Gem:
                this.MarkType = UnitGaugeMark.EMarkType.MapGem;
                break;
            }
        }
コード例 #23
0
ファイル: UnitGaugeMark.cs プロジェクト: zunaalabaya/TAC-BOT
        public void SetEndByUnitType(EUnitType Type)
        {
            switch (Type)
            {
            case EUnitType.Treasure:
                this.SetEndAnimation(UnitGaugeMark.EMarkType.MapChest);
                break;

            case EUnitType.Gem:
                this.SetEndAnimation(UnitGaugeMark.EMarkType.MapGem);
                break;
            }
        }
コード例 #24
0
ファイル: Monster.cs プロジェクト: dqtoy/ActDemo
        public void Init(int unitID, int level,
                         EUnitType unitType = EUnitType.EUT_Monster, ACT.EUnitCamp unitCamp = ACT.EUnitCamp.EUC_ENEMY,
                         bool aiEnable      = false, int aiDiff = 0)
        {
            base.Init(unitID, level, unitType, unitCamp);

            mAIEnable = aiEnable;
            AIDiff    = aiDiff;

            if (mAIEnable)
            {
                ActStatus.Bind(new ACT.AIListener(this, this));
            }
        }
コード例 #25
0
 public ValueRow(
     int index, string name, float value, string format, UnitConvert unit,
     bool save = false, bool chart = false, EUnitType yAxis = EUnitType.None)
 {
     Index   = index;
     Name    = name;
     Value   = value;
     Format  = format;
     Unit    = unit;
     State   = EValueState.None;
     YAxis   = yAxis;
     Chart   = chart;
     Save    = save;
     Storage = (Save == true) ? new ValueStorage(csLength) : null;
 }
コード例 #26
0
 public InvoiceItem(
     IObjectIdentifier <ulong> id,
     string name,
     decimal unitPrice,
     EUnitType unitType,
     decimal discount,
     double quantity
     )
 {
     Id        = id;
     Name      = name;
     UnitPrice = unitPrice;
     UnitType  = unitType;
     Discount  = discount;
     Quantity  = quantity;
 }
コード例 #27
0
 private InvoiceItemDto(
     IObjectIdentifier <ulong> id,
     string name,
     decimal unitPrice,
     EUnitType unitType,
     decimal discount,
     double quantity
     )
 {
     _id        = id;
     _name      = name;
     _unitPrice = unitPrice;
     _unitType  = unitType;
     _discount  = discount;
     _quantity  = quantity;
 }
コード例 #28
0
        public void TestUnit(EFaction factions, EUnitType unitType, int number)
        {
            GameObject      go       = new GameObject();
            CSpriteRenderer sp       = new CSpriteRenderer(SpriteContainer.Instance.Pixel);
            CAnimator       animator = new CAnimator();
            CUnit           unit     = new CUnit(ETeam.Team01, unitType, factions);
            CMove           move     = new CMove();

            go.AddComponent <CUnit>(unit);
            go.AddComponent <CMove>(move);
            go.AddComponent <CSpriteRenderer>(sp);
            go.AddComponent <CAnimator>(animator);

            go.Transform.Position -= new Microsoft.Xna.Framework.Vector2(650 - 150 * number, 0);
            Instantiate(go);
        }
コード例 #29
0
        ObjectPoolBase GetPoolByType(EUnitType unitType)
        {
            ObjectPoolBase tmpObjPool = null;

            switch (unitType)
            {
            case EUnitType.EUT_LocalPlayer:
                tmpObjPool = Game.PoolMgr.GetObjectPool <HudInfoPlayer>() as ObjectPoolBase;
                break;

            default:
                tmpObjPool = Game.PoolMgr.GetObjectPool <HudInfoMonster>() as ObjectPoolBase;
                break;
            }

            return(tmpObjPool);
        }
コード例 #30
0
        private int GetUnitAvailable(EUnitType type)
        {
            switch (type)
            {
            case EUnitType.Archer:
                return(_iArchersAvalaible);

            case EUnitType.Swordsman:
                return(_iSwordsAvalaible);

            case EUnitType.Spearman:
                return(_iSpearsAvalaible);

            default:
                return(0);
            }
        }
コード例 #31
0
ファイル: UnitCacheInfo.cs プロジェクト: wuhuolong/MaxBooks
        public UnitCacheInfo(EUnitType type, uint obj_idx)
        {
            UnitID         = new UnitID();
            UnitID.type    = (byte)type;
            UnitID.obj_idx = obj_idx;

            if (type == EUnitType.UNITTYPE_PLAYER)
            {
                AOIPlayer = new UnitEnterAOI._Player();
            }
            else if (type == EUnitType.UNITTYPE_MONSTER)
            {
                AOIMonster = new UnitEnterAOI._Monster();
            }
            else if (type == EUnitType.UNITTYPE_PET)
            {
                AOIPet = new UnitEnterAOI._Pet();
            }
        }
コード例 #32
0
        private void AddLevel(EUnitType type)
        {
            switch (type)
            {
            case EUnitType.Archer:
                _archerLVL++;
                SetLevel(EUnitType.Archer, _archerLVL);
                break;

            case EUnitType.Swordsman:
                _swordsmanLVL++;
                SetLevel(EUnitType.Swordsman, _swordsmanLVL);
                break;

            case EUnitType.Spearman:
                _spearmanLVL++;
                SetLevel(EUnitType.Spearman, _spearmanLVL);
                break;
            }
        }
コード例 #33
0
ファイル: DefenderWorld.cs プロジェクト: GodLesZ/svn-dump
		protected virtual int BuildWave() {
			int spawn = mSpawnRand.Next(Spawns.Count);
			UnitType++;
			if ((int)UnitType >= (int)EUnitType.MAX)
				UnitType = EUnitType.Basic;

			mWaves.Add(new UnitWave(UnitType, Spawns[spawn], SpawnSize, TileSize, mUnitInterval));
			return spawn;
		}
コード例 #34
0
ファイル: UnitTypeWave.cs プロジェクト: GodLesZ/svn-dump
		public UnitTypeWave( EUnitType unitType, Crossroad spawn, int numUnits, int tileSize, float interval )
			: base( unitType, spawn, numUnits, tileSize, interval ) {
		}
コード例 #35
0
ファイル: Village.cs プロジェクト: pkim/TravianBot
 public EReturnCode TrainUnit(EUnitType _unitType, int _amount)
 {
     throw new NotImplementedException();
 }