Exemple #1
0
 public BaseMovement(SerializationInfo info, StreamingContext ctxt)
 {
     OriginOutpost   = (Outpost)info.GetValue("originOutpost", typeof(Outpost));
     DestinationBase = (Position)info.GetValue("destination", typeof(Position));
     StartTick       = (int)info.GetValue("starttick", typeof(int));
     Duration        = (int)info.GetValue("duration", typeof(int));
 }
 public AIController(SerializationInfo info, StreamingContext ctxt)
 {
     TurtleAttacking       = (float)info.GetValue("TurtleAttacking", typeof(float));
     ActionDelayMultiplier = (float)info.GetValue("ActionDelayMultiplier", typeof(float));
     HelpSelfish           = (float)info.GetValue("HelpSelfish", typeof(float));
     Outpost     = (Outpost)info.GetValue("AIOutpost", typeof(Outpost));
     ActionDelay = (int)info.GetValue("ActionDelay", typeof(int));
     AttackDealy = (int)info.GetValue("AttackDealy", typeof(int));
 }
Exemple #3
0
 public BuildQueueItem(SerializationInfo info, StreamingContext ctxt)
 {
     resourcesRemaining = (List <long>)info.GetValue("resourcesRemaining", typeof(List <long>));
     PlayerId           = (int)info.GetValue("playerid", typeof(int));
     Outpost            = (Outpost)info.GetValue("outpost", typeof(Outpost));
     ItemType           = (int)info.GetValue("itemtype", typeof(int));
     ItemTotal          = (int)info.GetValue("itemtotal", typeof(int));
     Complete           = (int)info.GetValue("complete", typeof(int));
     BuildQueueID       = (Guid)info.GetValue("BuildQueue", typeof(Guid));
 }
 public TroopMovement(SerializationInfo info, StreamingContext ctxt)
 {
     MovementType       = (Cmn.MovType)info.GetValue("movetype", typeof(Cmn.MovType));
     Defence            = (List <long>)info.GetValue("Defence", typeof(List <long>));
     Offence            = (List <long>)info.GetValue("Offence", typeof(List <long>));
     OriginOutpost      = (Outpost)info.GetValue("OriginOutpost", typeof(Outpost));
     DestinationOutpost = (Outpost)info.GetValue("DestinationOutpost", typeof(Outpost));
     Address            = (UniversalAddress)info.GetValue("Address", typeof(UniversalAddress));
     StartTick          = (int)info.GetValue("StartTick", typeof(int));
     Duration           = (int)info.GetValue("Duration", typeof(int));
 }
Exemple #5
0
        public BuildQueueItem(int playerid, Outpost outpost, long total, int type, List <long> cost)
        {
            Complete  = 0;
            PlayerId  = playerid;
            Outpost   = outpost;
            ItemTotal = total;
            ItemType  = type;


            resourcesRemaining = new List <long>();

            foreach (var r in Cmn.Resource)
            {
                resourcesRemaining.Add(0);
            }

            resourcesRemaining[Cmn.Resource[Cmn.Renum.Food]]       = cost[Cmn.Resource[Cmn.Renum.Food]] * ItemTotal;
            resourcesRemaining[Cmn.Resource[Cmn.Renum.Metal]]      = cost[Cmn.Resource[Cmn.Renum.Metal]] * ItemTotal;
            resourcesRemaining[Cmn.Resource[Cmn.Renum.Population]] = cost[Cmn.Resource[Cmn.Renum.Population]] * ItemTotal;
            resourcesRemaining[Cmn.Resource[Cmn.Renum.Power]]      = cost[Cmn.Resource[Cmn.Renum.Power]] * ItemTotal;
            resourcesRemaining[Cmn.Resource[Cmn.Renum.Water]]      = cost[Cmn.Resource[Cmn.Renum.Water]] * ItemTotal;

            BuildQueueID = Guid.NewGuid();
        }