Exemple #1
0
        public static UnitOrder CreateSetElevationOrder(string unitId, GameConstants.HeightDepthPoints heightDepth)
        {
            UnitOrder order = new UnitOrder(GameConstants.UnitOrderType.SetElevation, unitId);

            order.HeightDepthPoints = heightDepth;
            return(order);
        }
Exemple #2
0
    public void ChangeHeightDepth(PlayerUnit unit, GameConstants.HeightDepthPoints heightDepthPoint)
    {
        if (unit != null)
        {
            GameManager.Instance.MessageManager.AddMessage(string.Format(
                                                               "Unit: {0} changing elevation from: {1} to : {2}",
                                                               unit.Info.UnitName, unit.Info.Position.HeightDepth.ToString(), heightDepthPoint.ToString()), GameManager.MessageTypes.Detection, unit.Info.Position);

            GameManager.Instance.NetworkManager.Send(OrderFactory.CreateSetElevationOrder(unit.Info.Id, heightDepthPoint));
        }
    }
        public void TestHeightDepthMark()
        {
            double hi  = 10000.0;
            double low = -200.0;
            double vhi = 100000.0;

            GameConstants.HeightDepthPoints HdHi  = hi.ToHeightDepthMark();
            GameConstants.HeightDepthPoints HdLo  = low.ToHeightDepthMark();
            GameConstants.HeightDepthPoints HdVHi = vhi.ToHeightDepthMark();
            System.Diagnostics.Debug.WriteLine(hi + " meters is " + HdHi, ToString());
            System.Diagnostics.Debug.WriteLine(low + " meters is " + HdLo, ToString());
            System.Diagnostics.Debug.WriteLine(vhi + " meters is " + HdVHi, ToString());

            Assert.AreEqual(HdHi, GameConstants.HeightDepthPoints.High, " Should be High.");
            Assert.AreEqual(HdLo, GameConstants.HeightDepthPoints.Deep, " Should be Deep.");
            Assert.AreEqual(HdVHi, GameConstants.HeightDepthPoints.VeryHigh, " Should be Very high.");
        }